aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-05-20 20:42:37 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-06-02 18:05:13 -0700
commit26de9b11713057a16a9220423a2f137774763b0e (patch)
treecf238a2873c5b3befbe1499f9005de554a759a9e /fs/f2fs/super.c
parentf2fs: remove syncing inode page in all the cases (diff)
downloadlinux-dev-26de9b11713057a16a9220423a2f137774763b0e.tar.xz
linux-dev-26de9b11713057a16a9220423a2f137774763b0e.zip
f2fs: avoid unnecessary updating inode during fsync
If roll-forward recovery can recover i_size, we don't need to update inode's metadata during fsync. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index b5144b81e4c4..6fa4ec8ea1f7 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -613,6 +613,9 @@ static void f2fs_dirty_inode(struct inode *inode, int flags)
inode->i_ino == F2FS_META_INO(sbi))
return;
+ if (is_inode_flag_set(inode, FI_AUTO_RECOVER))
+ clear_inode_flag(inode, FI_AUTO_RECOVER);
+
spin_lock(&sbi->inode_lock[DIRTY_META]);
if (is_inode_flag_set(inode, FI_DIRTY_INODE)) {
spin_unlock(&sbi->inode_lock[DIRTY_META]);
@@ -638,6 +641,7 @@ void f2fs_inode_synced(struct inode *inode)
}
list_del_init(&F2FS_I(inode)->gdirty_list);
clear_inode_flag(inode, FI_DIRTY_INODE);
+ clear_inode_flag(inode, FI_AUTO_RECOVER);
dec_page_count(sbi, F2FS_DIRTY_IMETA);
spin_unlock(&sbi->inode_lock[DIRTY_META]);
stat_dec_dirty_inode(F2FS_I_SB(inode), DIRTY_META);