bmap: Added initial gbatc interactions, up until out-of-known or remount

This only works immediately after format, and only for one pass of the
disk, but it's a good way to test bmap lookups/allocation without
worrying about more complicated filesystem-wide interactions.
This commit is contained in:
Christopher Haster
2025-07-24 23:41:02 -05:00
parent 357526e775
commit 98f016b07e
3 changed files with 128 additions and 6 deletions
+11
View File
@@ -949,7 +949,18 @@ typedef struct lfs3 {
uint8_t grm_d[LFS3_GRM_DSIZE];
#if !defined(LFS3_RDONLY) && !defined(LFS3_2BONLY) && defined(LFS3_BMAP)
// TODO do we only need known for the in-flight block-map?
// on-disk block-map
lfs3_gbmap_t gbmap;
// in-flight block-map
struct {
lfs3_block_t cursor;
lfs3_block_t known;
lfs3_block_t free;
//lfs3_block_t erased; // TODO
lfs3_btree_t gbatc;
} bmap;
// block-map delta state
uint8_t gbmap_p[LFS3_GBMAP_DSIZE];
uint8_t gbmap_d[LFS3_GBMAP_DSIZE];
#endif