*/
int i, max_segs;
u64 T = 0;
+ int force_checkpoint_after_clean = 0;
for (i = 0; i < fs->devices; i++)
T += fs->devs[i].size;
* otherwise don't.
*/
if (fs->segtrack->clean.cnt == 0
- && test_bit(CleanerBlocks, &fs->fsstate))
+ && test_bit(CleanerBlocks, &fs->fsstate)) {
max_segs = 1;
+ force_checkpoint_after_clean = 1;
+ }
}
for (i = 0; i < max_segs; i++) {
struct toclean *tc = &fs->cleaner.seg[i];
tc->seq = 0;
INIT_LIST_HEAD(&tc->cleaning);
fs->cleaner.active = 1;
+ if (force_checkpoint_after_clean)
+ lafs_checkpoint_start(fs);
}
if (i == CLEANER_SEGS)
dprintk("CLEANER: found %d segments to clean\n", i);