f2fs: remove unnecessary gc option check and balance_fs
authorChangman Lee <cm224.lee@samsung.com>
Mon, 4 Feb 2013 01:05:09 +0000 (10:05 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Mon, 11 Feb 2013 22:15:02 +0000 (07:15 +0900)
 1. If f2fs is mounted with background_gc_off option, checking
    BG_GC is not redundant.
 2. f2fs_balance_fs is checked in f2fs_gc, so this is also redundant.

Signed-off-by: Changman Lee <cm224.lee@samsung.com>
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>
fs/f2fs/gc.c

index 375e69e2c6f1cdd85f0f356435e1a2598f6cf297..8d293cb685ba1caec0d3e98af15af4242c3ef2cb 100644 (file)
@@ -49,11 +49,6 @@ static int gc_thread_func(void *data)
                        continue;
                }
 
-               f2fs_balance_fs(sbi);
-
-               if (!test_opt(sbi, BG_GC))
-                       continue;
-
                /*
                 * [GC triggering condition]
                 * 0. GC is not conducted currently.
@@ -96,6 +91,8 @@ int start_gc_thread(struct f2fs_sb_info *sbi)
 {
        struct f2fs_gc_kthread *gc_th;
 
+       if (!test_opt(sbi, BG_GC))
+               return 0;
        gc_th = kmalloc(sizeof(struct f2fs_gc_kthread), GFP_KERNEL);
        if (!gc_th)
                return -ENOMEM;