Merge branches 'acpi-ec', 'acpi-soc', 'acpi-video' and 'acpi-resources'
[firefly-linux-kernel-4.4.55.git] / fs / f2fs / gc.c
index 67860b6712f3c8f4d676b851a298e94e44245088..76adbc3641f1534ead6151b06dd8257219f7911e 100644 (file)
@@ -44,7 +44,7 @@ static int gc_thread_func(void *data)
                        break;
 
                if (sbi->sb->s_writers.frozen >= SB_FREEZE_WRITE) {
-                       wait_ms = increase_sleep_time(gc_th, wait_ms);
+                       increase_sleep_time(gc_th, &wait_ms);
                        continue;
                }
 
@@ -65,15 +65,15 @@ static int gc_thread_func(void *data)
                        continue;
 
                if (!is_idle(sbi)) {
-                       wait_ms = increase_sleep_time(gc_th, wait_ms);
+                       increase_sleep_time(gc_th, &wait_ms);
                        mutex_unlock(&sbi->gc_mutex);
                        continue;
                }
 
                if (has_enough_invalid_blocks(sbi))
-                       wait_ms = decrease_sleep_time(gc_th, wait_ms);
+                       decrease_sleep_time(gc_th, &wait_ms);
                else
-                       wait_ms = increase_sleep_time(gc_th, wait_ms);
+                       increase_sleep_time(gc_th, &wait_ms);
 
                stat_inc_bggc_count(sbi);
 
@@ -698,8 +698,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi)
                .iroot = RADIX_TREE_INIT(GFP_NOFS),
        };
 
-       cpc.reason = test_opt(sbi, FASTBOOT) ? CP_UMOUNT : CP_SYNC;
-
+       cpc.reason = __get_cp_reason(sbi);
 gc_more:
        if (unlikely(!(sbi->sb->s_flags & MS_ACTIVE)))
                goto stop;