lafs_leaf_next(lai->iblock, 1) != 0xffffffff)
goto give_up;
}
+ /* Need checkpoint lock to pin the dblock */
+ lafs_checkpoint_lock(fs);
if (test_and_clear_bit(B_Dirty, &b->flags)) {
int credits = 1;
/* Check size again, just in case it changed */
if (test_and_set_bit(B_Dirty, &b->flags))
if (test_and_set_bit(B_Credit, &b->flags))
lafs_space_return(fs, 1);
+ lafs_checkpoint_unlock(fs);
goto give_up;
}
if (!test_and_set_bit(B_Credit, &lai->dblock->b.flags))
if (!test_and_set_bit(B_ICredit, &lai->dblock->b.flags))
credits--;
lafs_space_return(fs, credits);
+ /* FIXME do I need to get a SegRef ?? */
+ if (test_bit(B_Pinned, &b->flags))
+ lafs_pin_block_ph(&lai->dblock->b, !!test_bit(B_Phase1, &b->flags));
+ else
+ lafs_pin_block(&lai->dblock->b);
lafs_dirty_dblock(lai->dblock);
} else if (test_and_clear_bit(B_Realloc, &b->flags)) {
int credits = 1;
printk("Wasn't dirty or realloc: %s\n", strblk(b));
LAFS_BUG(1, b);
}
+ lafs_checkpoint_unlock(fs);
lai->depth = 0;
lai->iblock->depth = 0;
clear_bit(B_Valid, &lai->iblock->b.flags);
BUG_ON(b==NULL);
+ lafs_checkpoint_lock(fs);
if (test_bit(B_Pinned, &db->b.flags))
ino_phase = !!test_bit(B_Phase1, &db->b.flags);
else if (test_bit(B_Pinned, &b->flags))
if (ino_phase == fs->phase) {
lafs_inode_fillblock(ino);
- if (!nodirty)
+ if (!nodirty) {
+ /* Pin to phase is safe as if it isn't
+ * pinned already, then InoIdx is Pinned,
+ * so all the prealloc is done
+ */
+ lafs_pin_block(&db->b);
lafs_dirty_dblock(db);
+ }
} else
set_bit(I_Dirty, &LAFSI(ino)->iflags);
+ lafs_checkpoint_unlock(fs);
putref(b, MKREF(dirty_inode));
}