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>
This commit is contained in:
Jaegeuk Kim 2016-01-07 14:15:04 -08:00
parent 2a4b8e9fab
commit 2c4db1a6f6
8 changed files with 33 additions and 38 deletions

View file

@ -213,7 +213,7 @@ int commit_inmem_pages(struct inode *inode, bool abort)
* inode becomes free by iget_locked in f2fs_iget.
*/
if (!abort) {
f2fs_balance_fs(sbi);
f2fs_balance_fs(sbi, true);
f2fs_lock_op(sbi);
}
@ -262,8 +262,10 @@ int commit_inmem_pages(struct inode *inode, bool abort)
* This function balances dirty node and dentry pages.
* In addition, it controls garbage collection.
*/
void f2fs_balance_fs(struct f2fs_sb_info *sbi)
void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need)
{
if (!need)
return;
/*
* We should do GC or end up with checkpoint, if there are so many dirty
* dir/node pages without enough free segments.