f2fs: introduce cp_control structure
[deliverable/linux.git] / fs / f2fs / super.c
index 7a91a381dcedae6fde102009f5f8914331ee4e65..128c42000fa3a9a9c6df5d1c084166d59dccb4ad 100644 (file)
@@ -434,8 +434,12 @@ static void f2fs_put_super(struct super_block *sb)
        stop_gc_thread(sbi);
 
        /* We don't need to do checkpoint when it's clean */
-       if (sbi->s_dirty)
-               write_checkpoint(sbi, true);
+       if (sbi->s_dirty) {
+               struct cp_control cpc = {
+                       .reason = CP_UMOUNT,
+               };
+               write_checkpoint(sbi, &cpc);
+       }
 
        /*
         * normally superblock is clean, so we need to release this.
@@ -466,8 +470,11 @@ int f2fs_sync_fs(struct super_block *sb, int sync)
        trace_f2fs_sync_fs(sb, sync);
 
        if (sync) {
+               struct cp_control cpc = {
+                       .reason = CP_SYNC,
+               };
                mutex_lock(&sbi->gc_mutex);
-               write_checkpoint(sbi, false);
+               write_checkpoint(sbi, &cpc);
                mutex_unlock(&sbi->gc_mutex);
        } else {
                f2fs_balance_fs(sbi);
This page took 0.034875 seconds and 5 git commands to generate.