Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15f92902 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim
Browse files

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: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 8dfee8c4
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -987,9 +987,9 @@ next_block:
						blkaddr == NULL_ADDR) {
						blkaddr == NULL_ADDR) {
				if (map->m_next_pgofs)
				if (map->m_next_pgofs)
					*map->m_next_pgofs = pgofs + 1;
					*map->m_next_pgofs = pgofs + 1;
				goto sync_out;
			}
			}
			if (flag != F2FS_GET_BLOCK_FIEMAP ||
			if (flag != F2FS_GET_BLOCK_FIEMAP)
						blkaddr != NEW_ADDR)
				goto sync_out;
				goto sync_out;
		}
		}
	}
	}