f2fs: move node pages only in victim section during GC
[deliverable/linux.git] / fs / f2fs / gc.c
index e82046523186b97890c66b21f4906b0b55da7190..19e9fafc5c70062343b23224bab6f1d9c727e286 100644 (file)
@@ -465,15 +465,7 @@ next_step:
                        continue;
                }
 
-               /* set page dirty and write it */
-               if (gc_type == FG_GC) {
-                       f2fs_wait_on_page_writeback(node_page, NODE, true);
-                       set_page_dirty(node_page);
-               } else {
-                       if (!PageWriteback(node_page))
-                               set_page_dirty(node_page);
-               }
-               f2fs_put_page(node_page, 1);
+               move_node_page(node_page, gc_type);
                stat_inc_node_blk_count(sbi, 1, gc_type);
        }
 
@@ -834,18 +826,9 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi,
                f2fs_put_page(sum_page, 0);
        }
 
-       if (gc_type == FG_GC) {
-               if (type == SUM_TYPE_NODE) {
-                       struct writeback_control wbc = {
-                               .sync_mode = WB_SYNC_ALL,
-                               .nr_to_write = LONG_MAX,
-                               .for_reclaim = 0,
-                       };
-                       sync_node_pages(sbi, &wbc);
-               } else {
-                       f2fs_submit_merged_bio(sbi, DATA, WRITE);
-               }
-       }
+       if (gc_type == FG_GC)
+               f2fs_submit_merged_bio(sbi,
+                               (type == SUM_TYPE_NODE) ? NODE : DATA, WRITE);
 
        blk_finish_plug(&plug);
 
This page took 0.037715 seconds and 5 git commands to generate.