summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-11-30 14:28:22 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2018-01-03 06:27:30 +0300
commit4c2ac6a86073a4cbcea123f8be84bd4417eae001 (patch)
treefd357883d941503af7963e60a794e6d85454fbba /fs/f2fs
parent416d2dbb4ebc0be6899c0155828ce03c9a01a023 (diff)
downloadlinux-4c2ac6a86073a4cbcea123f8be84bd4417eae001.tar.xz
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>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/data.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index ce1a4e94e551..7aca6ccd01f6 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -987,9 +987,9 @@ next_block:
blkaddr == NULL_ADDR) {
if (map->m_next_pgofs)
*map->m_next_pgofs = pgofs + 1;
+ goto sync_out;
}
- if (flag != F2FS_GET_BLOCK_FIEMAP ||
- blkaddr != NEW_ADDR)
+ if (flag != F2FS_GET_BLOCK_FIEMAP)
goto sync_out;
}
}