f2fs: check curseg space before foreground GC
authorChao Yu <yuchao0@huawei.com>
Mon, 30 Oct 2017 09:49:54 +0000 (17:49 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 19 Dec 2017 03:38:24 +0000 (19:38 -0800)
commit270e78cfc169ce160300e9493b01a96c0495567b
treefb3868bc0f53c6f7c8dbd72b264f1f23ea0d21cb
parentd3ad907d7caaa56a0b1ba03913d54ab3ddc31569
f2fs: check curseg space before foreground GC

When we are closing to trigger foreground GC, if there are only a few
of dirty metas, we can log these dirty metas in left space of opened
segments instead of triggering foreground GC.

With this patch, total count of foreground GC triggered by
test/generic/* of fstest suit reduce from 254 to 184.

So let's do the check before foreground GC anyway.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/segment.h