diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-06-06 18:49:54 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-06-08 10:25:52 -0700 |
commit | aa987273290d206b298e9d09db83e32ead661098 (patch) | |
tree | 8d082a03a5e2cc4af524073fcbacb650308a41a5 /fs/f2fs | |
parent | 19a5f5e2ef37f032efd840ada257bce2e91c8066 (diff) | |
download | talos-obmc-linux-aa987273290d206b298e9d09db83e32ead661098.tar.gz talos-obmc-linux-aa987273290d206b298e9d09db83e32ead661098.zip |
f2fs: skip clean segment for gc
If a segment in a section is clean or prefreed, we don't need to get its summary
and do gc.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r-- | fs/f2fs/gc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 67fd2855ccc9..e1d274cdecb8 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -795,6 +795,10 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, } for (segno = start_segno; segno < end_segno; segno++) { + + if (get_valid_blocks(sbi, segno, 1) == 0) + continue; + /* find segment summary of victim */ sum_page = find_get_page(META_MAPPING(sbi), GET_SUM_BLOCK(sbi, segno)); |