aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/gc.c
diff options
context:
space:
mode:
authorNamjae Jeon <namjae.jeon@samsung.com>2013-01-30 08:47:02 -0500
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-02-11 17:15:00 -0500
commit3786dfdf4f00755ce5797c0e87eac8f898acb52c (patch)
tree6428ad37cb01e8d47d2d2bd17935620e9bddbf27 /fs/f2fs/gc.c
parentd6212a5f18c8f9f9cc884070a96e11907711217f (diff)
f2fs: avoid redundant call to has_not_enough_free_secs in f2fs_gc
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>
Diffstat (limited to 'fs/f2fs/gc.c')
-rw-r--r--fs/f2fs/gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 9b5d0aad5daf..fb03be68cb20 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -672,7 +672,7 @@ gc_more:
672 if (!(sbi->sb->s_flags & MS_ACTIVE)) 672 if (!(sbi->sb->s_flags & MS_ACTIVE))
673 goto stop; 673 goto stop;
674 674
675 if (has_not_enough_free_secs(sbi)) 675 if (gc_type == BG_GC && has_not_enough_free_secs(sbi))
676 gc_type = FG_GC; 676 gc_type = FG_GC;
677 677
678 if (!__get_victim(sbi, &segno, gc_type, NO_CHECK_TYPE)) 678 if (!__get_victim(sbi, &segno, gc_type, NO_CHECK_TYPE))