Added LFS_REVDBG, tweaked LFS_REVNOISE
This tweaks a number of extended revision count things:
- Added LFS_REVDBG, which adds debug info to revision counts.
This initializes the bottom 12 bits of every revision count with a
hint based on rbyd type, which may be useful when debugging:
- 68 69 21 v0 (hi!.) => mroot anchor
- 6d 72 7e v0 (mr~.) => mroot
- 6d 64 7e v0 (md~.) => mdir
- 62 74 7e v0 (bt~.) => file btree node
- 62 6d 7e v0 (bm~.) => mtree node
This may be overwritten by the recycle counter if it overlaps, worst
case the recycle counter takes up the entire revision count, but these
have been chosen to at least keep some info if partially overwritten.
To make this work required the LFS_i_INMTREE hack (yay global state),
but a hack for debug info isn't the end of the world.
Note we don't have control over data blocks, so there's always a
chance they end up containing what looks like one of the above
revision counts.
- Renamed LFS_NOISY -> LFS_REVNOISE
- LFS_REVDBG and LFS_REVNOISE are incompatible, so using both asserts.
This also frees up the theoretical 0x00000030 state for an additional
rev mode in the future.
- Adopted LFS_REVNOISE (and LFS_REVDBG) in btree nodes as well.
If you need rev noise, you probably want it in all rbyds/metadata
blocks, not just mdirs.
---
This had no effect on the default code size, but did affect
LFS_REVNOISE:
code stack ctx
before: 35688 2440 640
after: 35688 (+0.0%) 2440 (+0.0%) 640 (+0.0%)
revnoise before: 35744 2440 640
revnoise after: 35880 (+0.4%) 2440 (+0.0%) 640 (+0.0%)
default: 35688 2440 640
revdbg: 35912 (+0.6%) 2448 (+0.3%) 640 (+0.0%)
revnoise: 35880 (+0.5%) 2440 (+0.0%) 640 (+0.0%)
This commit is contained in:
@@ -162,8 +162,11 @@ enum lfs_type {
|
||||
// Filesystem format flags
|
||||
#define LFS_F_MODE 1 // Format's access mode
|
||||
#define LFS_F_RDWR 0 // Format the filesystem as read and write
|
||||
#ifdef LFS_NOISY
|
||||
#define LFS_F_NOISY 0x00000010 // Add noise to revision counts
|
||||
#ifdef LFS_REVDBG
|
||||
#define LFS_F_REVDBG 0x00000010 // Add debug info to revision counts
|
||||
#endif
|
||||
#ifdef LFS_REVNOISE
|
||||
#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
|
||||
@@ -188,8 +191,11 @@ enum lfs_type {
|
||||
#define LFS_M_RDONLY 1 // Mount the filesystem as read only
|
||||
#define LFS_M_FLUSH 0x00000040 // Open all files with LFS_O_FLUSH
|
||||
#define LFS_M_SYNC 0x00000080 // Open all files with LFS_O_SYNC
|
||||
#ifdef LFS_NOISY
|
||||
#define LFS_M_NOISY 0x00000010 // Add noise to revision counts
|
||||
#ifdef LFS_REVDBG
|
||||
#define LFS_M_REVDBG 0x00000010 // Add debug info to revision counts
|
||||
#endif
|
||||
#ifdef LFS_REVNOISE
|
||||
#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
|
||||
@@ -216,8 +222,11 @@ enum lfs_type {
|
||||
#define LFS_I_RDONLY 0x00000001 // Mounted read only
|
||||
#define LFS_I_FLUSH 0x00000040 // Mounted with LFS_M_FLUSH
|
||||
#define LFS_I_SYNC 0x00000080 // Mounted with LFS_M_SYNC
|
||||
#ifdef LFS_NOISY
|
||||
#define LFS_I_NOISY 0x00000010 // Mounted with LFS_M_NOISY
|
||||
#ifdef LFS_REVDBG
|
||||
#define LFS_I_REVDBG 0x00000010 // Mounted with LFS_M_REVDBG
|
||||
#endif
|
||||
#ifdef LFS_REVNOISE
|
||||
#define LFS_I_REVNOISE 0x00000020 // Mounted with LFS_M_REVNOISE
|
||||
#endif
|
||||
#ifdef LFS_CKPROGS
|
||||
#define LFS_I_CKPROGS 0x00000800 // Mounted with LFS_M_CKPROGS
|
||||
@@ -240,6 +249,11 @@ enum lfs_type {
|
||||
#define LFS_I_CKMETA 0x00100000 // Metadata checksums not checked recently
|
||||
#define LFS_I_CKDATA 0x00200000 // Data checksums not checked recently
|
||||
|
||||
// internally used flags, don't use these
|
||||
#ifdef LFS_REVDBG
|
||||
#define LFS_i_INMTREE 0x01000000 // Committing to mtree
|
||||
#endif
|
||||
|
||||
|
||||
// Block types
|
||||
enum lfs_btype {
|
||||
|
||||
Reference in New Issue
Block a user