diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-10-24 14:19:18 +0900 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-10-25 16:54:38 +0900 |
commit | 4660f9c0fe484353b17a4b9d1cc2b036fa895f76 (patch) | |
tree | b992484821791c6b87dc3debfc7df6139dff6480 /fs/f2fs/node.c | |
parent | 81eb8d6e2869b119d4a7b8c02091c3779733a3ac (diff) | |
download | linux-4660f9c0fe484353b17a4b9d1cc2b036fa895f76.tar.bz2 |
f2fs: introduce f2fs_balance_fs_bg for some background jobs
This patch merges some background jobs into this new function.
Signed-off-by: Changman Lee <cm224.lee@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r-- | fs/f2fs/node.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 89dd8a5a3ca3..7bac4815f1d6 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -240,7 +240,7 @@ retry: write_unlock(&nm_i->nat_tree_lock); } -static int try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink) +int try_to_free_nats(struct f2fs_sb_info *sbi, int nr_shrink) { struct f2fs_nm_info *nm_i = NM_I(sbi); @@ -1205,12 +1205,8 @@ static int f2fs_write_node_pages(struct address_space *mapping, struct f2fs_sb_info *sbi = F2FS_SB(mapping->host->i_sb); long nr_to_write = wbc->nr_to_write; - /* First check balancing cached NAT entries */ - if (try_to_free_nats(sbi, NAT_ENTRY_PER_BLOCK) || - excess_prefree_segs(sbi)) { - f2fs_sync_fs(sbi->sb, true); - return 0; - } + /* balancing f2fs's metadata in background */ + f2fs_balance_fs_bg(sbi); /* collect a number of dirty node pages and write together */ if (get_pages(sbi, F2FS_DIRTY_NODES) < COLLECT_DIRTY_NODES) |