strcat(ans, "Phase1,");
else
strcat(ans, "Phase0,");
- if (test_bit(B_IOLock, &b->flags) &&
- test_bit(B_Valid, &b->flags)) {
- if (test_bit(B_WritePhase1, &b->flags))
- strcat(ans, "WPhase1,");
- else
- strcat(ans, "WPhase0,");
- }
}
if (test_bit(B_PinPending, &b->flags))
strcat(ans, "PinPending,");
db = getdref(lai->dblock, MKREF(flush2db));
ibuf = map_dblock(db);
dbuf = map_dblock_2(dblk(b));
- if (test_bit(B_Phase1, &b->flags))
- set_bit(B_WritePhase1, &b->flags);
- else
- clear_bit(B_WritePhase1, &b->flags);
if (test_and_clear_bit(B_UnincCredit, &b->flags))
lafs_space_return(fs, 1);
int credits = 0;
b = list_entry(wc->clhead.next, struct block, lru);
dprintk("flushing %s\n", strblk(b));
- if (test_bit(B_Phase1, &b->flags))
- set_bit(B_WritePhase1, &b->flags);
- else
- clear_bit(B_WritePhase1, &b->flags);
if (test_and_clear_bit(B_Realloc, &b->flags))
credits++;
MKREF(cflush));
spin_unlock(&dblk(b)->my_inode->i_data.private_lock);
- if (ib) {
- if (test_bit(B_Phase1, &ib->b.flags))
- set_bit(B_WritePhase1, &ib->b.flags);
- else
- clear_bit(B_WritePhase1, &ib->b.flags);
- putiref(ib, MKREF(cflush));
- }
+ putiref(ib, MKREF(cflush));
}
spin_lock(&fs->lock);
list_del(&b->lru);
* at least until it is written. We actually wait until the
* phase passes
* The same applies to InoIdx blocks.
- * FIXME use WritePhase here ???
* FIXME should I encourage this with a cluster_flush ??
*/
void lafs_phase_wait(struct block *b)
/* that *must* succeed as we own a reference on the block already */
LAFS_BUG(ob == NULL, &b->b);
- lafs_phase_wait(&ob->b);
err = lafs_pin_dblock(ob, ReleaseSpace);
if (err) {
putdref(ob, MKREF(orphan));
lafs_checkpoint_lock(fs);
- lafs_phase_wait(&ob1->b);
-
if (lafs_pin_dblock(ob1, ReleaseSpace) < 0)
goto out;
printk("OUCH 2\n");
goto out_unlock;
}
- lafs_phase_wait(&ob2->b);
if (lafs_pin_dblock(ob2, ReleaseSpace) < 0) {
putdref(ob2, MKREF(orphan_move));
goto out_unlock;
#define dblk(__bl) container_of(__bl, struct datablock, b)
enum {
- /* NOTE: 32 flags in used. Need to overlap 'data' with 'index' if
- * we need more
+ /* NOTE: 31 flags in used. Need to overlap 'data' with 'index' if
+ * we need much more
*/
/* First flags that are meaningful for both Data and Index blocks
- * Currently 23 */
+ * Currently 22 */
B_Phase1 = 0, /* phase when pinned - must be '1' - used for indexing */
B_Dirty, /* block has changes which haven't been committed */
B_Index, /* This is an index block, not a data block */
B_Linked, /* block is known to be linked with all peers */
- B_WritePhase1, /* Block is pinned and has been written to this phase. */
B_Realloc, /* If set on a B_Dirty block, it was only dirtied for
* cleaning purposes and so should be written to the
* cleaner segment.