summaryrefslogtreecommitdiff
path: root/fs/f2fs/data.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-01-08 01:15:04 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2016-01-08 22:45:23 +0300
commit2c4db1a6f6b42e2a9fb611cbbeb71a3a9a358ee0 (patch)
treec61e7933ca50c9f69d54adc216e6384a186e3082 /fs/f2fs/data.c
parent2a4b8e9fab9cea45d90179d9ee8e718c5ed26457 (diff)
downloadlinux-2c4db1a6f6b42e2a9fb611cbbeb71a3a9a358ee0.tar.xz
f2fs: clean up f2fs_balance_fs
This patch adds one parameter to clean up all the callers of f2fs_balance_fs. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r--fs/f2fs/data.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 3cf86fda8138..6fae75ddae6d 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -546,8 +546,7 @@ static int __allocate_data_blocks(struct inode *inode, loff_t offset,
f2fs_put_dnode(&dn);
f2fs_unlock_op(sbi);
- if (dn.node_changed)
- f2fs_balance_fs(sbi);
+ f2fs_balance_fs(sbi, dn.node_changed);
}
return err;
@@ -557,8 +556,7 @@ sync_out:
f2fs_put_dnode(&dn);
out:
f2fs_unlock_op(sbi);
- if (dn.node_changed)
- f2fs_balance_fs(sbi);
+ f2fs_balance_fs(sbi, dn.node_changed);
return err;
}
@@ -657,8 +655,7 @@ get_next:
if (create) {
f2fs_unlock_op(sbi);
- if (dn.node_changed)
- f2fs_balance_fs(sbi);
+ f2fs_balance_fs(sbi, dn.node_changed);
f2fs_lock_op(sbi);
}
@@ -718,8 +715,7 @@ put_out:
unlock_out:
if (create) {
f2fs_unlock_op(sbi);
- if (dn.node_changed)
- f2fs_balance_fs(sbi);
+ f2fs_balance_fs(sbi, dn.node_changed);
}
out:
trace_f2fs_map_blocks(inode, map, err);
@@ -1178,8 +1174,7 @@ out:
if (err)
ClearPageUptodate(page);
unlock_page(page);
- if (need_balance_fs)
- f2fs_balance_fs(sbi);
+ f2fs_balance_fs(sbi, need_balance_fs);
if (wbc->for_reclaim || unlikely(f2fs_cp_error(sbi))) {
f2fs_submit_merged_bio(sbi, DATA, WRITE);
remove_dirty_inode(inode);
@@ -1506,7 +1501,7 @@ repeat:
if (need_balance && has_not_enough_free_secs(sbi, 0)) {
unlock_page(page);
- f2fs_balance_fs(sbi);
+ f2fs_balance_fs(sbi, true);
lock_page(page);
if (page->mapping != mapping) {
/* The page got truncated from under us */