Signed-off-by: NeilBrown <neilb@suse.de>
!test_bit(CheckpointNeeded, &fs->fsstate) &&
fs->checkpointing == 0);
}
+
+void lafs_checkpoint_wait(struct fs *fs)
+{
+ /* Wait until there is no checkpoint requested or happening.
+ * This is used to implement filesystem-wide sync
+ */
+ wait_event(fs->phase_wait,
+ !test_bit(CheckpointNeeded, &fs->fsstate) &&
+ fs->checkpointing == 0);
+}
void lafs_checkpoint_lock(struct fs *fs);
void lafs_checkpoint_unlock(struct fs *fs);
void lafs_checkpoint_unlock_wait(struct fs *fs);
+void lafs_checkpoint_wait(struct fs *fs);
unsigned long long lafs_checkpoint_start(struct fs *fs);
unsigned long lafs_do_checkpoint(struct fs *fs);
struct block *lafs_get_flushable(struct fs *fs, int phase);
*/
lafs_checkpoint_start(fs_from_sb(sb));
else
- printk("FIXME I should wait for the checkpoint to finish\n");
+ lafs_checkpoint_wait(fs_from_sb(sb));
return 0;
}