]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/f2fs/gc.c
f2fs: introduce f2fs_balance_fs_bg for some background jobs
[karo-tx-linux.git] / fs / f2fs / gc.c
index 7914b92a696748ad191b8c0defcfe481085e2a14..b7ad1ec7e4ccb50227d1b48ce6d9ee7d26796f07 100644 (file)
@@ -77,13 +77,15 @@ static int gc_thread_func(void *data)
                else
                        wait_ms = increase_sleep_time(gc_th, wait_ms);
 
-#ifdef CONFIG_F2FS_STAT_FS
-               sbi->bg_gc++;
-#endif
+               stat_inc_bggc_count(sbi);
 
                /* if return value is not zero, no victim was selected */
                if (f2fs_gc(sbi))
                        wait_ms = gc_th->no_gc_sleep_time;
+
+               /* balancing f2fs's metadata periodically */
+               f2fs_balance_fs_bg(sbi);
+
        } while (!kthread_should_stop());
        return 0;
 }