rattrs: Allowed LFS3_RATTR_TAIL as alternate rattr-list terminator

LFS3_tag_RATTRS, now LFS3_tag_TAIL, is a bit funny in that it only
supports tail-recursive rattrs. The whole point of littlefs is
bounded-RAM after all. And if we know LFS3_tag_TAIL will terminate an
rattr-list, why bother with an additional LFS3_tag_NULL?

Like LFS3_RATTR_NULL, LFS3_RATTR_TAIL sets length=0 to indicate the end
of the rattr-lists.

Saves a bit of code:

                 code          stack          ctx
  before:       35324           2176          660
  after:        35316 (-0.0%)   2176 (+0.0%)  660 (+0.0%)

                 code          stack          ctx
  gbmap before: 38156           2192          772
  gbmap after:  38148 (-0.0%)   2192 (+0.0%)  772 (+0.0%)
This commit is contained in:
Christopher Haster
2025-11-29 21:56:16 -06:00
parent dca915dd95
commit ce6cbc3c77
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -829,7 +829,7 @@ enum lfs3_tag {
// in-device only tags, these should never get written to disk
LFS3_tag_INTERNAL = 0x0000,
LFS3_tag_RATTRS = 0x0001,
LFS3_tag_TAIL = 0x0001,
LFS3_tag_SHRUBCOMMIT = 0x0002,
LFS3_tag_GRMPUSH = 0x0003,
LFS3_tag_MOVE = 0x0004,