diff options
author | Chao Yu <chao2.yu@samsung.com> | 2016-02-22 18:32:13 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-02-22 21:40:00 -0800 |
commit | 17d899df4678a19b6715e225e2c2d175151887a7 (patch) | |
tree | 2859183c3c0ad022455cc91029b48070ba2ea76f /fs | |
parent | 4ce537763eeb6b9d453f84b70c69c609973ccc1e (diff) | |
download | blackbird-obmc-linux-17d899df4678a19b6715e225e2c2d175151887a7.tar.gz blackbird-obmc-linux-17d899df4678a19b6715e225e2c2d175151887a7.zip |
f2fs: fix the wrong stat count of calling gc
With a partition which was formated as multi segments in one section,
we stated incorrectly for count of gc operation.
e.g., for a partition with segs_per_sec = 4
cat /sys/kernel/debug/f2fs/status
GC calls: 208 (BG: 7)
- data segments : 104 (52)
- node segments : 104 (24)
GC called count should be (104 (data segs) + 104 (node segs)) / 4 = 52,
rather than 208. Fix it.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/f2fs/gc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index c01353429ba0..8d63fc0b84ea 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -820,7 +820,6 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, gc_type); stat_inc_seg_count(sbi, type, gc_type); - stat_inc_call_count(sbi->stat_info); f2fs_put_page(sum_page, 0); } @@ -845,6 +844,9 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, if (get_valid_blocks(sbi, start_segno++, 1) == 0) seg_freed++; } + + stat_inc_call_count(sbi->stat_info); + return seg_freed; } |