]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/f2fs/gc.c
f2fs: reclaim prefree segments periodically
[karo-tx-linux.git] / fs / f2fs / gc.c
index cb286d7b02b284a9cc6d89ca942f087db8f8be9b..783c6cc6253c2d9fb4a13d507617a012de8149ef 100644 (file)
@@ -82,6 +82,11 @@ static int gc_thread_func(void *data)
                /* if return value is not zero, no victim was selected */
                if (f2fs_gc(sbi))
                        wait_ms = gc_th->no_gc_sleep_time;
+
+               /* balancing prefree segments */
+               if (excess_prefree_segs(sbi))
+                       f2fs_sync_fs(sbi->sb, true);
+
        } while (!kthread_should_stop());
        return 0;
 }