f2fs: introduce cur_cp_version function to reduce code size
This patch introduces a new inline function, cur_cp_version, to reduce redundant
codes.
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 8ef3184..bd4184e 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -161,8 +161,7 @@
need_cp = true;
else if (!is_checkpointed_node(sbi, F2FS_I(inode)->i_pino))
need_cp = true;
- else if (F2FS_I(inode)->xattr_ver ==
- le64_to_cpu(F2FS_CKPT(sbi)->checkpoint_ver))
+ else if (F2FS_I(inode)->xattr_ver == cur_cp_version(F2FS_CKPT(sbi)))
need_cp = true;
if (need_cp) {