]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/f2fs/node.c
f2fs: reclaim prefree segments periodically
[karo-tx-linux.git] / fs / f2fs / node.c
index cc119b65a0d3ff9dc6b96283a703497c591e7cce..89dd8a5a3ca36275327ac85342887b780d0ec47f 100644 (file)
@@ -1206,7 +1206,8 @@ static int f2fs_write_node_pages(struct address_space *mapping,
        long nr_to_write = wbc->nr_to_write;
 
        /* First check balancing cached NAT entries */
-       if (try_to_free_nats(sbi, NAT_ENTRY_PER_BLOCK)) {
+       if (try_to_free_nats(sbi, NAT_ENTRY_PER_BLOCK) ||
+                               excess_prefree_segs(sbi)) {
                f2fs_sync_fs(sbi->sb, true);
                return 0;
        }