From: NeilBrown Date: Sat, 26 Jun 2010 01:38:08 +0000 (+1000) Subject: Revise which blocks need N* credits. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=1fb0378848087f9909f0772ed4c7acd7499ca2d8;p=LaFS.git Revise which blocks need N* credits. I think it is just those that might be phase-flipped. Let's hope that is right. I think the others were there due to cleaning issues which have not been resolved. Signed-off-by: NeilBrown --- diff --git a/modify.c b/modify.c index c0b231e..b3f9070 100644 --- a/modify.c +++ b/modify.c @@ -1934,15 +1934,12 @@ retry: else if (!test_and_set_bit(B_ICredit, &b->flags)) credits--; } - /* FIXME: should I check PinPending rather than the different - * inode types? - * And do I only need NCredit if already dirty ... or something + /* We need N*Credits if this block might need to be + * phase-flipped and remain pinned in the next + * phase. i.e. index blocks and accounting blocks. */ if (test_bit(B_Index, &b->flags) || - LAFSI(b->inode)->type == TypeInodeFile || - LAFSI(b->inode)->type == TypeOrphanList || LAFSI(b->inode)->type == TypeQuota || - LAFSI(b->inode)->type == TypeDir || LAFSI(b->inode)->type == TypeSegmentMap) { if (credits <= 0) need += !test_bit(B_NCredit, &b->flags);