fs->cleaner.cleaning = 0;
fs->checkpoint_youth = youth;
- fs->newblocks = 0;
+ fs->newsegments = 0;
lafs_wake_thread(fs);
}
!test_bit(FinalCheckpoint, &fs->fsstate)) {
/* not compulsory, but maybe just time */
if (fs->cleaner.active == 0 &&
- fs->newblocks > fs->max_newblocks)
+ fs->newsegments > fs->max_newsegs)
set_bit(CheckpointNeeded, &fs->fsstate);
}
BUG_ON(wc->seg.dev != dev);
BUG_ON(wc->seg.num != seg);
+ if (cnum == 0)
+ /* wc mutex protects us here */
+ fs->newsegments++;
+
return 0;
}
lafs_allocated_block(fs, b, addr);
blocks++;
}
- if (cnum == 0)
- fs->newblocks += blocks;
if (head_start)
cluster_closehead(wc, head_start);
} cleaner;
struct task_struct *thread;
- unsigned long newblocks; /* number of blocks written since checkpoint
- * FIXME this should probably be a count
- * of segments (?)
- */
- unsigned long max_newblocks; /* max blocks in a checkpoint (roughly) */
+ unsigned long newsegments; /* number of segments written since checkpoint */
+ unsigned long max_newsegs; /* max segments in a checkpoint (roughly) */
/* counters for (pre)allocating space. */
spinlock_t alloc_lock;
fs->wc[i].seg.dev = -1;
}
- fs->max_newblocks = 1000; /* FIXME this should be configurable, and
- * guessed better
- */
+ fs->max_newsegs = 32; /* FIXME this should be configurable */
err = -ENOMEM;
fs->devs = kzalloc(sizeof(struct fs_dev)*fs->devices, GFP_KERNEL);