struct fs *fs = data;
int oldphase = !fs->phase; /*FIXME could there be a race getting this?*/
struct block *b;
- int cnt = 0;
#ifdef DUMP
dfs = fs;
#endif
dprintk("Start Checkpoint\n");
if (lafs_trace)
lafs_dump_tree();
+ again:
while ((b = lafs_get_flushable(fs, oldphase)) != NULL) {
int unlock = 1;
dprintk("Checkpoint Block %s\n", strblk(b));
lafs_iounlock_block(b, 0);
putref(b, MKREF(leaf));
- if (list_empty(&fs->phase_leafs[oldphase])) {
- lafs_cluster_flush(fs, 0);
- lafs_cluster_wait_all(fs);
- lafs_clusters_done(fs);
- }
- cnt++;
}
- lafs_clusters_done(fs);
-
if (test_bit(B_Pinned, &LAFSI(fs->ss[0].root)->iblock->b.flags) &&
!!test_bit(B_Phase1, &LAFSI(fs->ss[0].root)->iblock->b.flags)
!= fs->phase) {
- struct indexblock *ib = LAFSI(fs->ss[0].root)->iblock;
- struct block *cb;
- printk("ROOT has not changed phase!! \n");
- lafs_dump_tree();
- cb = &ib->b;
- printk("Root %s Block still old: %s\n",
- test_bit(B_Index, &cb->flags) ? "Index" : "Data",
- strblk(cb));
-
- list_for_each_entry(cb, &ib->children, siblings)
- if (test_bit(B_Pinned, &cb->flags)) {
- int pp = !!test_bit(B_Phase1, &cb->flags);
- if (pp != fs->phase)
- printk("%s Block still old: %s\n",
- test_bit(B_Index, &cb->flags)
- ? "Index" : "Data",
- strblk(cb));
- }
- BUG();
+ BUG_ON(list_empty(&fs->wc[0].clhead));
+ lafs_cluster_flush(fs, 0);
+ lafs_cluster_wait_all(fs);
+ lafs_clusters_done(fs);
+ goto again;
}
+ lafs_clusters_done(fs);
}
static void finish_checkpoint(struct fs *fs, int youth)