f2fs: refactor resize_fs to avoid meta updates in progress
[linux-2.6-microblaze.git] / fs / f2fs / checkpoint.c
index 79e605f..620a386 100644 (file)
@@ -1559,7 +1559,8 @@ int f2fs_write_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
                        return 0;
                f2fs_warn(sbi, "Start checkpoint disabled!");
        }
-       mutex_lock(&sbi->cp_mutex);
+       if (cpc->reason != CP_RESIZE)
+               mutex_lock(&sbi->cp_mutex);
 
        if (!is_sbi_flag_set(sbi, SBI_IS_DIRTY) &&
                ((cpc->reason & CP_FASTBOOT) || (cpc->reason & CP_SYNC) ||
@@ -1628,7 +1629,8 @@ stop:
        f2fs_update_time(sbi, CP_TIME);
        trace_f2fs_write_checkpoint(sbi->sb, cpc->reason, "finish checkpoint");
 out:
-       mutex_unlock(&sbi->cp_mutex);
+       if (cpc->reason != CP_RESIZE)
+               mutex_unlock(&sbi->cp_mutex);
        return err;
 }