diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-10-24 01:19:18 -0400 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2013-10-25 03:54:38 -0400 |
commit | 4660f9c0fe484353b17a4b9d1cc2b036fa895f76 (patch) | |
tree | b992484821791c6b87dc3debfc7df6139dff6480 /fs/f2fs/segment.c | |
parent | 81eb8d6e2869b119d4a7b8c02091c3779733a3ac (diff) |
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/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 62b52f2f293a..8e5ca2869913 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c | |||
@@ -36,6 +36,14 @@ void f2fs_balance_fs(struct f2fs_sb_info *sbi) | |||
36 | } | 36 | } |
37 | } | 37 | } |
38 | 38 | ||
39 | void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi) | ||
40 | { | ||
41 | /* check the # of cached NAT entries and prefree segments */ | ||
42 | if (try_to_free_nats(sbi, NAT_ENTRY_PER_BLOCK) || | ||
43 | excess_prefree_segs(sbi)) | ||
44 | f2fs_sync_fs(sbi->sb, true); | ||
45 | } | ||
46 | |||
39 | static void __locate_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno, | 47 | static void __locate_dirty_segment(struct f2fs_sb_info *sbi, unsigned int segno, |
40 | enum dirty_type dirty_type) | 48 | enum dirty_type dirty_type) |
41 | { | 49 | { |