diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-20 20:42:37 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-06-02 18:05:13 -0700 |
commit | 26de9b11713057a16a9220423a2f137774763b0e (patch) | |
tree | cf238a2873c5b3befbe1499f9005de554a759a9e /fs/f2fs/super.c | |
parent | ee6d182f2a19d5d44607b5ae4bec523726d76a99 (diff) | |
download | talos-op-linux-26de9b11713057a16a9220423a2f137774763b0e.tar.gz talos-op-linux-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.c | 4 |
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); |