summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorChangman Lee <cm224.lee@samsung.com>2013-01-31 17:16:56 +0900
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-02-12 07:15:01 +0900
commitfacb0205401a6ce4be410e1f4b9357bbc6caa36a (patch)
treea5bebda2f25fe616a65edaadd2c879d0d110e0a0 /fs/f2fs
parentd4686d56ec912d55fd8a9d6d509de50de24e90ab (diff)
f2fs: stop repeated checking if cp is needed
If it is decided that f2fs should do checkpoint, skip next comparison. Signed-off-by: Changman Lee <cm224.lee@samsung.com>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/file.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 3efa4739b00c..33d1736ee5f9 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -157,11 +157,11 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
if (!S_ISREG(inode->i_mode) || inode->i_nlink != 1)
need_cp = true;
- if (is_inode_flag_set(F2FS_I(inode), FI_NEED_CP))
+ else if (is_inode_flag_set(F2FS_I(inode), FI_NEED_CP))
need_cp = true;
- if (!space_for_roll_forward(sbi))
+ else if (!space_for_roll_forward(sbi))
need_cp = true;
- if (need_to_sync_dir(sbi, inode))
+ else if (need_to_sync_dir(sbi, inode))
need_cp = true;
if (need_cp) {