trv: Reduced LFS3_t_CKPOINTED + LFS3_t_MUTATED -> LFS3_t_CKPOINTED
This drops LFS3_t_MUTATED in favor of just using LFS3_t_CKPOINTED
everywhere:
1. These meant roughly the same thing, with LFS3_t_MUTATED being a bit
tighter at the cost of needing to be explicitly set.
2. The implicit setting of LFS3_t_CKPOINTED by lfs3_alloc_ckpoint -- a
function that already needs to be called before mutation -- means we
have one less thing to worry about.
Implicit properties like LFS3_t_CKPOINTED are great for building a
reliable system. Manual flags like LFS3_t_MUTATED, not so much.
3. Why use two flags when we can get away with one?
The only downside is we may unnecessarily clobber gc/traversal work when
we don't actually mutate the filesystem. Failed file open calls are a
good example.
However this tradeoff seems well worth it for an overall simpler +
more reliable system.
---
Saves a bit of code:
code stack ctx
before: 37220 2352 688
after: 37160 (-0.2%) 2352 (+0.0%) 688 (+0.0%)
code stack ctx
gbmap before: 40184 2368 856
gbmap after: 40132 (-0.1%) 2368 (+0.0%) 856 (+0.0%)
This commit is contained in:
@@ -344,10 +344,9 @@ enum lfs3_btype {
|
||||
#define LFS3_t_TSTATE 0x000f0000 // The current traversal state
|
||||
#define LFS3_t_BTYPE 0x00f00000 // The current block type
|
||||
#define LFS3_t_ZOMBIE 0x08000000 // File has been removed
|
||||
#define LFS3_t_DIRTY 0x04000000 // Filesystem modified outside traversal
|
||||
#define LFS3_t_MUTATED 0x02000000 // Filesystem modified during traversal
|
||||
#define LFS3_t_DIRTY 0x04000000 // Filesystem ckpointed outside traversal
|
||||
#define LFS3_t_CKPOINTED \
|
||||
0x01000000 // Filesystem ckpointed during traversal
|
||||
0x02000000 // Filesystem ckpointed during traversal
|
||||
|
||||
// GC flags
|
||||
#ifndef LFS3_RDONLY
|
||||
|
||||
Reference in New Issue
Block a user