If a checkpoint is wanted, the cleaner shouldn't start any more work.
If the cleaner or segscan is active a checkpoint cannot start, but
when they complete they should wake the checkpoint process.
Signed-off-by: NeilBrown <neilb@suse.de>
return MAX_SCHEDULE_TIMEOUT;
if (fs->cleaner.active || ! fs->scan.done)
- return HZ/10; /* FIXME that is gross ... is it needed? */
+ return MAX_SCHEDULE_TIMEOUT;
/* Make sure all cleaner blocks are flushed as if anything lingers
* in the cleaner cluster, they will stop the checkpoint from making
*
*/
if (!fs->cleaner.active &&
+ !test_bit(CheckpointNeeded, &fs->fsstate) &&
!test_bit(CleanerDisabled, &fs->fsstate)) {
/* choose to clean when the fraction of all space that is clean
* is below the faction of free space that is not clean.
cleaner_flush(fs);
if (cnt == 0) {
fs->cleaner.active = 0;
- wake_up(&fs->async_complete);
+ lafs_wake_thread(fs);
}
}
if (test_bit(CleanerBlocks, &fs->fsstate)) {
}
if (dev == -1) {
fs->scan.done = 1;
- wake_up(&fs->phase_wait);
+ lafs_wake_thread(fs);
return MAX_SCHEDULE_TIMEOUT;
}