summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-10-19 18:27:56 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-11-23 12:11:09 -0800
commit18340edc8da20b0d399eb25ba4bb631b27652f46 (patch)
tree74d27396c2f5be10db454f003cc263fdb51aa11c /fs/f2fs
parent7c45729a4d6d1c90879e6c5c2df325c2f6db7191 (diff)
downloadlwn-18340edc8da20b0d399eb25ba4bb631b27652f46.tar.gz
lwn-18340edc8da20b0d399eb25ba4bb631b27652f46.zip
f2fs: make clean inodes when flushing inode page
This patch tries to make more clean inodes when flushing dirty inodes in checkpoint. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/checkpoint.c6
-rw-r--r--fs/f2fs/inode.c2
2 files changed, 6 insertions, 2 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 157b7fdc2c67..e5677e4a69d6 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -921,7 +921,11 @@ int f2fs_sync_inode_meta(struct f2fs_sb_info *sbi)
inode = igrab(&fi->vfs_inode);
spin_unlock(&sbi->inode_lock[DIRTY_META]);
if (inode) {
- update_inode_page(inode);
+ sync_inode_metadata(inode, 0);
+
+ /* it's on eviction */
+ if (is_inode_flag_set(inode, FI_DIRTY_INODE))
+ update_inode_page(inode);
iput(inode);
}
};
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index bfa512dde4ab..7b5e402f0a72 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -339,7 +339,7 @@ int f2fs_write_inode(struct inode *inode, struct writeback_control *wbc)
* We need to balance fs here to prevent from producing dirty node pages
* during the urgent cleaning time when runing out of free sections.
*/
- if (update_inode_page(inode))
+ if (update_inode_page(inode) && wbc && wbc->nr_to_write)
f2fs_balance_fs(sbi, true);
return 0;
}