From 5b74aafa176315b4fae0a188dcab3bdaec9639e3 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sat, 24 May 2025 22:16:42 -0500 Subject: [PATCH] Reworked the flag encoding again This time to account for the new LFS_o_UNCRYST and LFS_o_UNGRAFT flags. This required moving the T flags out of the way, which of course conflicted with TSTATE, so that had to move... One thing that helped was shoving LFS_O_DESYNC up with the internal state flags. It's definitely more a state flag than the other public flags, it just also happens to be user toggleable. Here's the new jenga: 8 8 8 8 .----++----++----++----. .-..----..-..-..-------. o_flags: |t|| f ||o||t|| o | |-||-.--':-:|-|'--.-.--' |-||-|.----.|-'--------. t_flags: |t||f||tstt|| t | '-''-''----'|----.-----' .----..-.:-:|----|:-:.-. m_flags: | m ||c||o|| t ||o||m| |----||-|'-'|-.--''-''-' |----||-|---|-|.-------. f_flags: | m ||c| |t|| f | '----''-'---'-''-------' This adds a bit of code, but that's not the end of the world: code stack ctx before: 37172 2288 636 after: 37200 (+0.1%) 2288 (+0.0%) 636 (+0.0%) --- lfs.c | 36 ++++++------- lfs.h | 97 +++++++++++++++++------------------ scripts/dbgflags.py | 120 ++++++++++++++++++++++---------------------- 3 files changed, 127 insertions(+), 126 deletions(-) diff --git a/lfs.c b/lfs.c index c347420c..ec3bdb2c 100644 --- a/lfs.c +++ b/lfs.c @@ -7022,6 +7022,18 @@ static inline bool lfsr_o_isbshrub(uint32_t flags) { || lfsr_o_type(flags) == LFS_type_TRAVERSAL; } +static inline bool lfsr_o_iszombie(uint32_t flags) { + return flags & LFS_o_ZOMBIE; +} + +static inline bool lfsr_o_isuncreat(uint32_t flags) { + return flags & LFS_o_UNCREAT; +} + +static inline bool lfsr_o_isunsync(uint32_t flags) { + return flags & LFS_o_UNSYNC; +} + static inline bool lfsr_o_isuncryst(uint32_t flags) { return flags & LFS_o_UNCRYST; } @@ -7034,18 +7046,6 @@ static inline bool lfsr_o_isunflush(uint32_t flags) { return flags & LFS_o_UNFLUSH; } -static inline bool lfsr_o_isunsync(uint32_t flags) { - return flags & LFS_o_UNSYNC; -} - -static inline bool lfsr_o_isuncreat(uint32_t flags) { - return flags & LFS_o_UNCREAT; -} - -static inline bool lfsr_o_iszombie(uint32_t flags) { - return flags & LFS_o_ZOMBIE; -} - // custom attr flags static inline bool lfsr_a_islazy(uint32_t flags) { return flags & LFS_A_LAZY; @@ -7078,11 +7078,11 @@ static inline bool lfsr_t_isckdata(uint32_t flags) { // internal traversal flags static inline uint8_t lfsr_t_tstate(uint32_t flags) { - return (flags >> 0) & 0xf; + return (flags >> 16) & 0xf; } static inline uint32_t lfsr_t_tstateflags(uint8_t tstate) { - return (uint32_t)tstate << 0; + return (uint32_t)tstate << 16; } static inline void lfsr_t_settstate(uint32_t *flags, uint8_t tstate) { @@ -7090,11 +7090,11 @@ static inline void lfsr_t_settstate(uint32_t *flags, uint8_t tstate) { } static inline uint8_t lfsr_t_btype(uint32_t flags) { - return (flags >> 8) & 0x0f; + return (flags >> 20) & 0x0f; } static inline uint32_t lfsr_t_btypeflags(uint8_t btype) { - return (uint32_t)btype << 8; + return (uint32_t)btype << 20; } static inline void lfsr_t_setbtype(uint32_t *flags, uint8_t btype) { @@ -7110,8 +7110,8 @@ static inline bool lfsr_t_ismutated(uint32_t flags) { } static inline uint32_t lfsr_t_swapdirty(uint32_t flags) { - uint32_t x = ((flags >> 25) ^ (flags >> 24)) & 0x1; - return flags ^ (x << 25) ^ (x << 24); + uint32_t x = ((flags >> 24) ^ (flags >> 25)) & 0x1; + return flags ^ (x << 24) ^ (x << 25); } // mount flags diff --git a/lfs.h b/lfs.h index c58270de..58d86de5 100644 --- a/lfs.h +++ b/lfs.h @@ -138,18 +138,18 @@ enum lfs_type { #define LFS_O_APPEND 0x00000020 // Move to end of file on every write #define LFS_O_FLUSH 0x00000040 // Flush data on every write #define LFS_O_SYNC 0x00000080 // Sync metadata on every write -#define LFS_O_DESYNC 0x00000100 // Do not sync or recieve file updates -#define LFS_O_CKMETA 0x00100000 // Check metadata checksums -#define LFS_O_CKDATA 0x00200000 // Check metadata + data checksums +#define LFS_O_DESYNC 0x04000000 // Do not sync or recieve file updates +#define LFS_O_CKMETA 0x00001000 // Check metadata checksums +#define LFS_O_CKDATA 0x00002000 // Check metadata + data checksums // internally used flags, don't use these #define LFS_o_TYPE 0xf0000000 // The file's type -#define LFS_o_UNCRYST 0x00400000 // File's leaf not fully crystallized -#define LFS_o_UNGRAFT 0x00800000 // File's leaf does not match bshrub/btree -#define LFS_o_UNFLUSH 0x01000000 // File's data does not match disk -#define LFS_o_UNSYNC 0x02000000 // File's metadata does not match disk -#define LFS_o_UNCREAT 0x04000000 // File does not exist yet #define LFS_o_ZOMBIE 0x08000000 // File has been removed +#define LFS_o_UNCREAT 0x02000000 // File does not exist yet +#define LFS_o_UNSYNC 0x01000000 // File's metadata does not match disk +#define LFS_o_UNCRYST 0x00800000 // File's leaf not fully crystallized +#define LFS_o_UNGRAFT 0x00400000 // File's leaf does not match bshrub/btree +#define LFS_o_UNFLUSH 0x00200000 // File's data does not match disk // File seek flags #define LFS_SEEK_SET 0 // Seek relative to an absolute position @@ -173,22 +173,22 @@ enum lfs_type { #define LFS_F_REVNOISE 0x00000020 // Add noise to revision counts #endif #ifdef LFS_CKPROGS -#define LFS_F_CKPROGS 0x00000800 // Check progs by reading back progged data +#define LFS_F_CKPROGS 0x00080000 // Check progs by reading back progged data #endif #ifdef LFS_CKFETCHES -#define LFS_F_CKFETCHES 0x00001000 // Check block checksums before first use +#define LFS_F_CKFETCHES 0x00100000 // Check block checksums before first use #endif #ifdef LFS_CKMETAPARITY #define LFS_F_CKMETAPARITY \ - 0x00002000 // Check metadata tag parity bits + 0x00200000 // Check metadata tag parity bits #endif #ifdef LFS_CKDATACKSUMREADS #define LFS_F_CKDATACKSUMREADS \ - 0x00008000 // Check data checksums on reads + 0x00800000 // Check data checksums on reads #endif -#define LFS_F_CKMETA 0x00100000 // Check metadata checksums -#define LFS_F_CKDATA 0x00200000 // Check metadata + data checksums +#define LFS_F_CKMETA 0x00001000 // Check metadata checksums +#define LFS_F_CKDATA 0x00002000 // Check metadata + data checksums // Filesystem mount flags #define LFS_M_MODE 1 // Mount's access mode @@ -203,26 +203,26 @@ enum lfs_type { #define LFS_M_REVNOISE 0x00000020 // Add noise to revision counts #endif #ifdef LFS_CKPROGS -#define LFS_M_CKPROGS 0x00000800 // Check progs by reading back progged data +#define LFS_M_CKPROGS 0x00080000 // Check progs by reading back progged data #endif #ifdef LFS_CKFETCHES -#define LFS_M_CKFETCHES 0x00001000 // Check block checksums before first use +#define LFS_M_CKFETCHES 0x00100000 // Check block checksums before first use #endif #ifdef LFS_CKMETAPARITY #define LFS_M_CKMETAPARITY \ - 0x00002000 // Check metadata tag parity bits + 0x00200000 // Check metadata tag parity bits #endif #ifdef LFS_CKDATACKSUMREADS #define LFS_M_CKDATACKSUMREADS \ - 0x00008000 // Check data checksums on reads + 0x00800000 // Check data checksums on reads #endif #define LFS_M_MKCONSISTENT \ - 0x00010000 // Make the filesystem consistent -#define LFS_M_LOOKAHEAD 0x00020000 // Populate lookahead buffer -#define LFS_M_COMPACT 0x00080000 // Compact metadata logs -#define LFS_M_CKMETA 0x00100000 // Check metadata checksums -#define LFS_M_CKDATA 0x00200000 // Check metadata + data checksums + 0x00000100 // Make the filesystem consistent +#define LFS_M_LOOKAHEAD 0x00000200 // Populate lookahead buffer +#define LFS_M_COMPACT 0x00000800 // Compact metadata logs +#define LFS_M_CKMETA 0x00001000 // Check metadata checksums +#define LFS_M_CKDATA 0x00002000 // Check metadata + data checksums // Filesystem info flags #define LFS_I_RDONLY 0x00000001 // Mounted read only @@ -235,30 +235,30 @@ enum lfs_type { #define LFS_I_REVNOISE 0x00000020 // Mounted with LFS_M_REVNOISE #endif #ifdef LFS_CKPROGS -#define LFS_I_CKPROGS 0x00000800 // Mounted with LFS_M_CKPROGS +#define LFS_I_CKPROGS 0x00080000 // Mounted with LFS_M_CKPROGS #endif #ifdef LFS_CKFETCHES -#define LFS_I_CKFETCHES 0x00001000 // Mounted with LFS_M_CKFETCHES +#define LFS_I_CKFETCHES 0x00100000 // Mounted with LFS_M_CKFETCHES #endif #ifdef LFS_CKMETAPARITY #define LFS_I_CKMETAPARITY \ - 0x00002000 // Mounted with LFS_M_CKMETAPARITY + 0x00200000 // Mounted with LFS_M_CKMETAPARITY #endif #ifdef LFS_CKDATACKSUMREADS #define LFS_I_CKDATACKSUMREADS \ - 0x00008000 // Mounted with LFS_M_CKDATACKSUMREADS + 0x00800000 // Mounted with LFS_M_CKDATACKSUMREADS #endif #define LFS_I_MKCONSISTENT \ - 0x00010000 // Filesystem needs mkconsistent to write -#define LFS_I_LOOKAHEAD 0x00020000 // Lookahead buffer is not full -#define LFS_I_COMPACT 0x00080000 // Filesystem may have uncompacted metadata -#define LFS_I_CKMETA 0x00100000 // Metadata checksums not checked recently -#define LFS_I_CKDATA 0x00200000 // Data checksums not checked recently + 0x00000100 // Filesystem needs mkconsistent to write +#define LFS_I_LOOKAHEAD 0x00000200 // Lookahead buffer is not full +#define LFS_I_COMPACT 0x00000800 // Filesystem may have uncompacted metadata +#define LFS_I_CKMETA 0x00001000 // Metadata checksums not checked recently +#define LFS_I_CKDATA 0x00002000 // Data checksums not checked recently // internally used flags, don't use these #ifdef LFS_REVDBG -#define LFS_i_INMTREE 0x01000000 // Committing to mtree +#define LFS_i_INMTREE 0x08000000 // Committing to mtree #endif @@ -270,29 +270,30 @@ enum lfs_btype { }; // Traversal flags -#define LFS_T_MTREEONLY 0x00000010 // Only traverse the mtree +#define LFS_T_MTREEONLY 0x00000004 // Only traverse the mtree #define LFS_T_MKCONSISTENT \ - 0x00010000 // Make the filesystem consistent -#define LFS_T_LOOKAHEAD 0x00020000 // Populate lookahead buffer -#define LFS_T_COMPACT 0x00080000 // Compact metadata logs -#define LFS_T_CKMETA 0x00100000 // Check metadata checksums -#define LFS_T_CKDATA 0x00200000 // Check metadata + data checksums + 0x00000100 // Make the filesystem consistent +#define LFS_T_LOOKAHEAD 0x00000200 // Populate lookahead buffer +#define LFS_T_COMPACT 0x00000800 // Compact metadata logs +#define LFS_T_CKMETA 0x00001000 // Check metadata checksums +#define LFS_T_CKDATA 0x00002000 // Check metadata + data checksums // internally used flags, don't use these -#define LFS_t_TSTATE 0x0000000f // The traversal's current tstate -#define LFS_t_BTYPE 0x00000f00 // The traversal's current btype -#define LFS_t_DIRTY 0x01000000 // Filesystem modified during traversal -#define LFS_t_MUTATED 0x02000000 // Filesystem modified by traversal +#define LFS_t_TYPE 0xf0000000 // The traversal's type +#define LFS_t_TSTATE 0x000f0000 // The current traversal state +#define LFS_t_BTYPE 0x00f00000 // The current block type #define LFS_t_ZOMBIE 0x08000000 // File has been removed +#define LFS_t_DIRTY 0x02000000 // Filesystem modified during traversal +#define LFS_t_MUTATED 0x01000000 // Filesystem modified by traversal // GC flags #define LFS_GC_MKCONSISTENT \ - 0x00010000 // Make the filesystem consistent + 0x00000100 // Make the filesystem consistent #define LFS_GC_LOOKAHEAD \ - 0x00020000 // Populate lookahead buffer -#define LFS_GC_COMPACT 0x00080000 // Compact metadata logs -#define LFS_GC_CKMETA 0x00100000 // Check metadata checksums -#define LFS_GC_CKDATA 0x00200000 // Check metadata + data checksums + 0x00000200 // Populate lookahead buffer +#define LFS_GC_COMPACT 0x00000800 // Compact metadata logs +#define LFS_GC_CKMETA 0x00001000 // Check metadata checksums +#define LFS_GC_CKDATA 0x00002000 // Check metadata + data checksums // Configuration provided during initialization of the littlefs diff --git a/scripts/dbgflags.py b/scripts/dbgflags.py index 072d152c..6cc1d473 100755 --- a/scripts/dbgflags.py +++ b/scripts/dbgflags.py @@ -32,9 +32,9 @@ FLAGS = [ ('O', 'APPEND', 0x00000020, "Move to end of file on every write" ), ('O', 'FLUSH', 0x00000040, "Flush data on every write" ), ('O', 'SYNC', 0x00000080, "Sync metadata on every write" ), - ('O', 'DESYNC', 0x00000100, "Do not sync or recieve file updates" ), - ('O', 'CKMETA', 0x00100000, "Check metadata checksums" ), - ('O', 'CKDATA', 0x00200000, "Check metadata + data checksums" ), + ('O', 'DESYNC', 0x04000000, "Do not sync or recieve file updates" ), + ('O', 'CKMETA', 0x00001000, "Check metadata checksums" ), + ('O', 'CKDATA', 0x00002000, "Check metadata + data checksums" ), ('o', 'TYPE', 0xf0000000, "The file's type" ), ('^', 'REG', 0x10000000, "Type = regular-file" ), @@ -44,12 +44,12 @@ FLAGS = [ ('^', 'ORPHAN', 0x50000000, "Type = orphan" ), ('^', 'TRAVERSAL', 0x60000000, "Type = traversal" ), ('^', 'UNKNOWN', 0x70000000, "Type = unknown" ), - ('o', 'UNCRYST', 0x00400000, "File's leaf not fully crystallized" ), - ('o', 'UNGRAFT', 0x00800000, "File's leaf does not match bshrub/btree" ), - ('o', 'UNFLUSH', 0x01000000, "File's data does not match disk" ), - ('o', 'UNSYNC', 0x02000000, "File's metadata does not match disk" ), - ('o', 'UNCREAT', 0x04000000, "File does not exist yet" ), ('o', 'ZOMBIE', 0x08000000, "File has been removed" ), + ('o', 'UNCREAT', 0x02000000, "File does not exist yet" ), + ('o', 'UNSYNC', 0x01000000, "File's metadata does not match disk" ), + ('o', 'UNCRYST', 0x00800000, "File's leaf not fully crystallized" ), + ('o', 'UNGRAFT', 0x00400000, "File's leaf does not match bshrub/btree" ), + ('o', 'UNFLUSH', 0x00200000, "File's data does not match disk" ), # Custom attribute flags ('A', 'MODE', 3, "The attr's access mode" ), @@ -63,15 +63,15 @@ FLAGS = [ ('^', 'RDWR', 0, "Format the filesystem as read and write" ), ('F', 'REVDBG', 0x00000010, "Add debug info to revision counts" ), ('F', 'REVNOISE', 0x00000020, "Add noise to revision counts" ), - ('F', 'CKPROGS', 0x00000800, "Check progs by reading back progged data" ), - ('F', 'CKFETCHES', 0x00001000, "Check block checksums before first use" ), + ('F', 'CKPROGS', 0x00080000, "Check progs by reading back progged data" ), + ('F', 'CKFETCHES', 0x00100000, "Check block checksums before first use" ), ('F', 'CKMETAPARITY', - 0x00002000, "Check metadata tag parity bits" ), + 0x00200000, "Check metadata tag parity bits" ), ('F', 'CKDATACKSUMREADS', - 0x00008000, "Check data checksums on reads" ), + 0x00800000, "Check data checksums on reads" ), - ('F', 'CKMETA', 0x00100000, "Check metadata checksums" ), - ('F', 'CKDATA', 0x00200000, "Check metadata + data checksums" ), + ('F', 'CKMETA', 0x00001000, "Check metadata checksums" ), + ('F', 'CKDATA', 0x00002000, "Check metadata + data checksums" ), # Filesystem mount flags ('M', 'MODE', 1, "Mount's access mode" ), @@ -81,27 +81,27 @@ FLAGS = [ ('M', 'SYNC', 0x00000080, "Open all files with LFS_O_SYNC" ), ('M', 'REVDBG', 0x00000010, "Add debug info to revision counts" ), ('M', 'REVNOISE', 0x00000020, "Add noise to revision counts" ), - ('M', 'CKPROGS', 0x00000800, "Check progs by reading back progged data" ), - ('M', 'CKFETCHES', 0x00001000, "Check block checksums before first use" ), + ('M', 'CKPROGS', 0x00080000, "Check progs by reading back progged data" ), + ('M', 'CKFETCHES', 0x00100000, "Check block checksums before first use" ), ('M', 'CKMETAPARITY', - 0x00002000, "Check metadata tag parity bits" ), + 0x00200000, "Check metadata tag parity bits" ), ('M', 'CKDATACKSUMREADS', - 0x00008000, "Check data checksums on reads" ), + 0x00800000, "Check data checksums on reads" ), ('M', 'MKCONSISTENT', - 0x00010000, "Make the filesystem consistent" ), - ('M', 'LOOKAHEAD', 0x00020000, "Populate lookahead buffer" ), - ('M', 'COMPACT', 0x00080000, "Compact metadata logs" ), - ('M', 'CKMETA', 0x00100000, "Check metadata checksums" ), - ('M', 'CKDATA', 0x00200000, "Check metadata + data checksums" ), + 0x00000100, "Make the filesystem consistent" ), + ('M', 'LOOKAHEAD', 0x00000200, "Populate lookahead buffer" ), + ('M', 'COMPACT', 0x00000800, "Compact metadata logs" ), + ('M', 'CKMETA', 0x00001000, "Check metadata checksums" ), + ('M', 'CKDATA', 0x00002000, "Check metadata + data checksums" ), # GC flags ('GC', 'MKCONSISTENT', - 0x00010000, "Make the filesystem consistent" ), - ('GC', 'LOOKAHEAD',0x00020000, "Populate lookahead buffer" ), - ('GC', 'COMPACT', 0x00080000, "Compact metadata logs" ), - ('GC', 'CKMETA', 0x00100000, "Check metadata checksums" ), - ('GC', 'CKDATA', 0x00200000, "Check metadata + data checksums" ), + 0x00000100, "Make the filesystem consistent" ), + ('GC', 'LOOKAHEAD',0x00000200, "Populate lookahead buffer" ), + ('GC', 'COMPACT', 0x00000800, "Compact metadata logs" ), + ('GC', 'CKMETA', 0x00001000, "Check metadata checksums" ), + ('GC', 'CKDATA', 0x00002000, "Check metadata + data checksums" ), # Filesystem info flags ('I', 'RDONLY', 0x00000001, "Mounted read only" ), @@ -109,32 +109,32 @@ FLAGS = [ ('I', 'SYNC', 0x00000080, "Mounted with LFS_M_SYNC" ), ('I', 'REVDBG', 0x00000010, "Mounted with LFS_M_REVDBG" ), ('I', 'REVNOISE', 0x00000020, "Mounted with LFS_M_REVNOISE" ), - ('I', 'CKPROGS', 0x00000800, "Mounted with LFS_M_CKPROGS" ), - ('I', 'CKFETCHES', 0x00001000, "Mounted with LFS_M_CKFETCHES" ), + ('I', 'CKPROGS', 0x00080000, "Mounted with LFS_M_CKPROGS" ), + ('I', 'CKFETCHES', 0x00100000, "Mounted with LFS_M_CKFETCHES" ), ('I', 'CKMETAPARITY', - 0x00002000, "Mounted with LFS_M_CKMETAPARITY" ), + 0x00200000, "Mounted with LFS_M_CKMETAPARITY" ), ('I', 'CKDATACKSUMREADS', - 0x00008000, "Mounted with LFS_M_CKDATACKSUMREADS" ), + 0x00800000, "Mounted with LFS_M_CKDATACKSUMREADS" ), ('I', 'MKCONSISTENT', - 0x00010000, "Filesystem needs mkconsistent to write" ), - ('I', 'LOOKAHEAD', 0x00020000, "Lookahead buffer is not full" ), - ('I', 'COMPACT', 0x00080000, "Filesystem may have uncompacted metadata" ), - ('I', 'CKMETA', 0x00100000, "Metadata checksums not checked recently" ), - ('I', 'CKDATA', 0x00200000, "Data checksums not checked recently" ), + 0x00000100, "Filesystem needs mkconsistent to write" ), + ('I', 'LOOKAHEAD', 0x00000200, "Lookahead buffer is not full" ), + ('I', 'COMPACT', 0x00000800, "Filesystem may have uncompacted metadata" ), + ('I', 'CKMETA', 0x00001000, "Metadata checksums not checked recently" ), + ('I', 'CKDATA', 0x00002000, "Data checksums not checked recently" ), - ('i', 'INMTREE', 0x01000000, "Committing to mtree" ), + ('i', 'INMTREE', 0x08000000, "Committing to mtree" ), # Traversal flags - ('T', 'MTREEONLY', 0x00000010, "Only traverse the mtree" ), + ('T', 'MTREEONLY', 0x00000004, "Only traverse the mtree" ), ('T', 'MKCONSISTENT', - 0x00010000, "Make the filesystem consistent" ), - ('T', 'LOOKAHEAD', 0x00020000, "Populate lookahead buffer" ), - ('T', 'COMPACT', 0x00080000, "Compact metadata logs" ), - ('T', 'CKMETA', 0x00100000, "Check metadata checksums" ), - ('T', 'CKDATA', 0x00200000, "Check metadata + data checksums" ), + 0x00000100, "Make the filesystem consistent" ), + ('T', 'LOOKAHEAD', 0x00000200, "Populate lookahead buffer" ), + ('T', 'COMPACT', 0x00000800, "Compact metadata logs" ), + ('T', 'CKMETA', 0x00001000, "Check metadata checksums" ), + ('T', 'CKDATA', 0x00002000, "Check metadata + data checksums" ), - ('t', 'TYPE', 0xf0000000, "The file's type" ), + ('t', 'TYPE', 0xf0000000, "The traversal's type" ), ('^', 'REG', 0x10000000, "Type = regular-file" ), ('^', 'DIR', 0x20000000, "Type = directory" ), ('^', 'STICKYNOTE',0x30000000, "Type = stickynote" ), @@ -142,24 +142,24 @@ FLAGS = [ ('^', 'ORPHAN', 0x50000000, "Type = orphan" ), ('^', 'TRAVERSAL', 0x60000000, "Type = traversal" ), ('^', 'UNKNOWN', 0x70000000, "Type = unknown" ), - ('t', 'TSTATE', 0x0000000f, "The traversal's current tstate" ), + ('t', 'TSTATE', 0x000f0000, "The current traversal state" ), ('^', 'MROOTANCHOR', 0x00000000, "Tstate = mroot-anchor" ), - ('^', 'MROOTCHAIN',0x00000001, "Tstate = mroot-chain" ), - ('^', 'MTREE', 0x00000002, "Tstate = mtree" ), - ('^', 'MDIRS', 0x00000003, "Tstate = mtree-mdirs" ), - ('^', 'MDIR', 0x00000004, "Tstate = mdir" ), - ('^', 'BTREE', 0x00000005, "Tstate = btree" ), - ('^', 'OMDIRS', 0x00000006, "Tstate = open-mdirs" ), - ('^', 'OBTREE', 0x00000007, "Tstate = open-btree" ), - ('^', 'DONE', 0x00000008, "Tstate = done" ), - ('t', 'BTYPE', 0x00000f00, "The traversal's current btype" ), - ('^', 'MDIR', 0x00000100, "Btype = mdir" ), - ('^', 'BTREE', 0x00000200, "Btype = btree" ), - ('^', 'DATA', 0x00000300, "Btype = data" ), - ('t', 'DIRTY', 0x01000000, "Filesystem modified during traversal" ), - ('t', 'MUTATED', 0x02000000, "Filesystem modified by traversal" ), + ('^', 'MROOTCHAIN',0x00010000, "Tstate = mroot-chain" ), + ('^', 'MTREE', 0x00020000, "Tstate = mtree" ), + ('^', 'MDIRS', 0x00030000, "Tstate = mtree-mdirs" ), + ('^', 'MDIR', 0x00040000, "Tstate = mdir" ), + ('^', 'BTREE', 0x00050000, "Tstate = btree" ), + ('^', 'OMDIRS', 0x00060000, "Tstate = open-mdirs" ), + ('^', 'OBTREE', 0x00070000, "Tstate = open-btree" ), + ('^', 'DONE', 0x00080000, "Tstate = done" ), + ('t', 'BTYPE', 0x00f00000, "The current block type" ), + ('^', 'MDIR', 0x00100000, "Btype = mdir" ), + ('^', 'BTREE', 0x00200000, "Btype = btree" ), + ('^', 'DATA', 0x00300000, "Btype = data" ), ('t', 'ZOMBIE', 0x08000000, "File has been removed" ), + ('t', 'DIRTY', 0x02000000, "Filesystem modified during traversal" ), + ('t', 'MUTATED', 0x01000000, "Filesystem modified by traversal" ), # Read-compat flags ('RCOMPAT', 'NONSTANDARD',