Readopted bshrub namespace, renamed ftree -> bshrub

This is just too useful a namespace to not have in the low-level file
code.

This also replaces the ftree namespace with bshrub, which is a bit of a
more concrete term?

Note that some of the bshrub functions still take lfsr_file_t instead
of lfsr_bshrub_t. In _theory_ these could take 3 pointers (mdir+bshrub+
bshrub_), but this adds a surprising amount of code cost and we really
don't gain anything.
This commit is contained in:
Christopher Haster
2024-01-20 02:00:30 -06:00
parent 9978b46a0c
commit 6436fd21cf
2 changed files with 220 additions and 218 deletions
+214 -212
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -499,8 +499,8 @@ typedef struct lfsr_shrub {
lfs_size_t estimate;
} lfsr_shrub_t;
// the lfsr_ftree_t struct is a sort of proto-file
typedef struct lfsr_ftree {
// the lfsr_bshrub_t struct represents the on-disk component of a file
typedef struct lfsr_bshrub {
// navigating this union is a bit tricky, and relies on the related
// mdir's block:
//
@@ -517,15 +517,15 @@ typedef struct lfsr_ftree {
lfsr_shrub_t bshrub;
lfsr_btree_t btree;
} u;
} lfsr_ftree_t;
} lfsr_bshrub_t;
typedef struct lfsr_file {
lfsr_opened_t m;
// files contain both an active tree and staging tree, to allow
// files contain both an active bshrub and staging bshrub, to allow
// staging during mdir compacts
lfsr_ftree_t ftree;
lfsr_ftree_t ftree_;
lfsr_bshrub_t bshrub;
lfsr_bshrub_t bshrub_;
lfs_off_t pos;
lfs_off_t buffer_pos;