]> git.neil.brown.name Git - LaFS.git/commitdiff
Group B_ flags by which sort of block they apply to.
authorNeilBrown <neilb@suse.de>
Sun, 13 Sep 2009 23:47:59 +0000 (09:47 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 13 Sep 2009 23:47:59 +0000 (09:47 +1000)
This will allow us to overlap the 'Data' and 'Index' groups
later if that proves necessary.

state.h

diff --git a/state.h b/state.h
index d6240edcb99436d7c4b43541a2e1ebd0ad85b658..8c7492f2a6b999a66d13cc798ccda737f4c9fc03 100644 (file)
--- a/state.h
+++ b/state.h
@@ -395,6 +395,8 @@ struct indexblock {
 #define dblk(__bl) container_of(__bl, struct datablock, b)
 
 enum {
+       /* First flags that are meaningful for both Data and Index blocks
+        * Currently 23 */
        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 */
@@ -405,21 +407,13 @@ enum {
                         * cleaning purposes and so should be written to the
                         * cleaner segment.
                         */
-       B_Valid ,       /* block contains valid data */
-       B_PinPending,    /* set on data blocks while checkpoint_locked if we might
-                          * want to mark them dirty
-                          */
-
+       B_Valid,        /* block contains valid data */
        B_Uninc,        /* on ->unincorporated list for next phase, so we
                         * cannot free it just yet.*/
        B_InoIdx,       /* is the index block for an inode */
-       B_Prealloc,     /* This data block has physaddr==0 and has been counted
-                        * in various ablock counters.
-                        */
        B_Pinned,       /* B_Phase1 is meaningful and block must be written
                         * (if dirty) in this phase
                         */
-       B_Orphan,       /* ->orphan_slot is valid */
        B_Async,          /* An async IO is pending on this block */
        B_Root,         /* data or index block for root. ->parent is NULL */
 
@@ -430,18 +424,32 @@ enum {
 
        B_NICredit,     /* ICredit for next phase */
        B_UnincCredit,  /* Uninc carries a credit */
-       B_OnFree,       /* index block on the free list */
        B_IOLock,       /* Block is undergoing IO */
        B_Writeback,    /* Block is in a cluster */
        B_IOLockLock,   /* lock while testing IOLock on a page */
 
+       B_WriteError,   /* Got a write error while writing (when else?) */
+       B_PhysValid,    /* ->physaddr is correct */
+
+       /* Flags that are only relevant for Data Block
+        * currently 6 */
+
+       B_PinPending,    /* set on data blocks while checkpoint_locked if we might
+                          * want to mark them dirty
+                          */
+       B_Prealloc,     /* This data block has physaddr==0 and has been counted
+                        * in various ablock counters.
+                        */
+       B_Orphan,       /* ->orphan_slot is valid */
+
        B_HaveLock,     /* We own the page lock and when all blocks are unlocked,
                         * the page should be unlocked */
        B_HaveWriteback,/* We own the page writeback flag and when all blocks
                         * are unlocked we should clear it. */
-       B_WriteError,   /* Got a write error while writing (when else?) */
        B_Claimed,      /* Used for exclusive allocation of inodes */
-       B_PhysValid,    /* ->physaddr is correct */
+       /* Flags that are only relevant for Index Blocks
+        * currently 1 */
+       B_OnFree,       /* index block on the free list */
 };
 /* indexing info stays in the block, not in the inode */
 struct lafs_inode {