f2fs: write checkpoint before starting FG_GC
authorJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 8 Apr 2013 07:01:00 +0000 (16:01 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Tue, 9 Apr 2013 09:21:24 +0000 (18:21 +0900)
In order to be aware of prefree and free sections during FG_GC, let's start with
write_checkpoint().

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/gc.c

index 83cec8f868c65ab63f185ec437ad64763953e2bd..37b05e1c574ca4dcd9821ae2fdfd60f345028b3e 100644 (file)
@@ -669,8 +669,10 @@ gc_more:
        if (!(sbi->sb->s_flags & MS_ACTIVE))
                goto stop;
 
-       if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree))
+       if (gc_type == BG_GC && has_not_enough_free_secs(sbi, nfree)) {
                gc_type = FG_GC;
+               write_checkpoint(sbi, false);
+       }
 
        if (!__get_victim(sbi, &segno, gc_type, NO_CHECK_TYPE))
                goto stop;