Skip to content

Commit

Permalink
f2fs: avoid redundant call to has_not_enough_free_secs in f2fs_gc
Browse files Browse the repository at this point in the history
After doing a write_checkpoint from garbage collection path if there is still
need to do more garbage collection, gc_more label is used to jump and start
the process again. And in that process, first step before getting victim is to
check if there are not enough free sections, which is already done before
doing a jump to gc_more. We can avoid the redundant call to check free
sections, by checking the gc_type flag which will remain FG_GC(value 1) under
this condition.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
  • Loading branch information
Namjae Jeon authored and Jaegeuk Kim committed Feb 11, 2013
1 parent d6212a5 commit 3786dfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/f2fs/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi)
if (!(sbi->sb->s_flags & MS_ACTIVE))
goto stop;

if (has_not_enough_free_secs(sbi))
if (gc_type == BG_GC && has_not_enough_free_secs(sbi))
gc_type = FG_GC;

if (!__get_victim(sbi, &segno, gc_type, NO_CHECK_TYPE))
Expand Down

0 comments on commit 3786dfd

Please sign in to comment.