diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-05-21 05:42:37 +0200 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-06-03 03:05:13 +0200 |
commit | 26de9b11713057a16a9220423a2f137774763b0e (patch) | |
tree | cf238a2873c5b3befbe1499f9005de554a759a9e /fs/f2fs/node.c | |
parent | f2fs: remove syncing inode page in all the cases (diff) | |
download | linux-26de9b11713057a16a9220423a2f137774763b0e.tar.xz 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/node.c')
-rw-r--r-- | fs/f2fs/node.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 82f0f833151e..641d60392bff 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1293,7 +1293,7 @@ continue_unlock: return last_page; } -int fsync_node_pages(struct f2fs_sb_info *sbi, nid_t ino, +int fsync_node_pages(struct f2fs_sb_info *sbi, struct inode *inode, struct writeback_control *wbc, bool atomic) { pgoff_t index, end; @@ -1301,6 +1301,7 @@ int fsync_node_pages(struct f2fs_sb_info *sbi, nid_t ino, int ret = 0; struct page *last_page = NULL; bool marked = false; + nid_t ino = inode->i_ino; if (atomic) { last_page = last_fsync_dnode(sbi, ino); @@ -1354,9 +1355,13 @@ continue_unlock: if (!atomic || page == last_page) { set_fsync_mark(page, 1); - if (IS_INODE(page)) + if (IS_INODE(page)) { + if (is_inode_flag_set(inode, + FI_DIRTY_INODE)) + update_inode(inode, page); set_dentry_mark(page, need_dentry_mark(sbi, ino)); + } /* may be written by other thread */ if (!PageDirty(page)) set_page_dirty(page); |