f2fs: clean up f2fs_map_blocks
authorChao Yu <yuchao0@huawei.com>
Thu, 30 Nov 2017 11:28:22 +0000 (19:28 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Sat, 27 Jan 2018 21:29:32 +0000 (13:29 -0800)
commit62e507cd2b91a5292cc819fc52524b6871977781
tree2d774335a88f12946d0c8b1e78f200dadb1bbc84
parent233b197757c02bdf7f4da4517e3aa6f30ffbc677
f2fs: clean up f2fs_map_blocks

f2fs_map_blocks():

if (blkaddr == NEW_ADDR || blkaddr == NULL_ADDR) {
if (create) {
...
} else {
...
if (flag == F2FS_GET_BLOCK_FIEMAP &&
blkaddr == NULL_ADDR) {
...
}
if (flag != F2FS_GET_BLOCK_FIEMAP ||
blkaddr != NEW_ADDR)
goto sync_out;
}

It means we can break the loop in cases of:
a) flag != F2FS_GET_BLOCK_FIEMAP or
b) flag == F2FS_GET_BLOCK_FIEMAP && blkaddr == NULL_ADDR

Condition b) is the same as previous one, so merge operations of them
for readability.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c