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:
Christopher Haster
2025-10-20 15:35:03 -05:00
parent 5d70e47708
commit 8a58954828
4 changed files with 22 additions and 53 deletions
+2 -3
View File
@@ -170,9 +170,8 @@ FLAGS = [
('^_BTREE', 0x00200000, "Btype = btree" ),
('^_DATA', 0x00300000, "Btype = data" ),
('t_ZOMBIE', 0x08000000, "File has been removed" ),
('t_DIRTY', 0x04000000, "Filesystem modified outside traversal" ),
('t_MUTATED', 0x02000000, "Filesystem modified during traversal" ),
('t_CKPOINTED', 0x01000000, "Filesystem ckpointed during traversal" ),
('t_DIRTY', 0x04000000, "Filesystem ckpointed outside traversal" ),
('t_CKPOINTED', 0x02000000, "Filesystem ckpointed during traversal" ),
# Block allocator flags
('alloc_ERASE', 0x00000001, "Please erase the block" ),