]> git.neil.brown.name Git - LaFS.git/commitdiff
Revise which blocks need N* credits.
authorNeilBrown <neilb@suse.de>
Sat, 26 Jun 2010 01:38:08 +0000 (11:38 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 27 Jun 2010 23:15:02 +0000 (09:15 +1000)
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 <neilb@suse.de>
modify.c

index c0b231e62e9eda65dbe2fef933262ced26235fec..b3f9070094e733d934d0e6e2ee5e0c20e7858213 100644 (file)
--- 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);