]> git.neil.brown.name Git - LaFS.git/commitdiff
rollforward: user writeback during add_block_address
authorNeilBrown <neilb@suse.de>
Sun, 17 Oct 2010 23:46:18 +0000 (10:46 +1100)
committerNeilBrown <neilb@suse.de>
Mon, 18 Oct 2010 01:26:45 +0000 (12:26 +1100)
For consistency with other callers of lafs_add_block_address,
hold writeback rather than iolock over this call.

Signed-off-by: NeilBrown <neilb@suse.de>
roll.c

diff --git a/roll.c b/roll.c
index 16e6d5e88cc871e5841021f31793608e0e57eb5c..0e6bda473abbbd699ada7012d5c8830c104b3827 100644 (file)
--- a/roll.c
+++ b/roll.c
@@ -461,14 +461,14 @@ roll_block(struct fs *fs, int fsnum, int inum, int trunc,
                                    0, fs->phase, 1);
                blk->b.physaddr = baddr;
                lafs_dirty_iblock(blk->b.parent, 0);
-               /* FIXME maybe set Writeback and unlock */
+               set_bit(B_Writeback, &blk->b.flags);
+               lafs_iounlock_block(&blk->b);
                if (lafs_add_block_address(fs, &blk->b) == 0)
                        /* FIXME if the table becomes full, we have a problem... */
                        LAFS_BUG(1, &blk->b);
                dprintk("Allocated block %lu to %llu\n",
                        (unsigned long)bnum, baddr);
-               /* FIXME maybe clear Writeback instead */
-               lafs_iounlock_block(&blk->b);
+               lafs_writeback_done(&blk->b);
 
                clear_bit(B_PinPending, &blk->b.flags);
                /* If we had previously read this block for some reason,