• Chao Yu's avatar
    f2fs: clean up f2fs_map_blocks · 4c2ac6a8
    Chao Yu authored
    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: default avatarChao Yu <yuchao0@huawei.com>
    Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
    4c2ac6a8
data.c 54.8 KB