Dropped special LFSR_MID_RM mid

This is mostly to make it easier to merge mids/rids. Having a special
constant here is tricky when the mid/rid split point is dynamic.

Currently using rbyd.trunk=0 to indicate when an mdir is dropped. This
is nice as it preserves the last mid/rid, which is needed by the readdir
code, and it implicitly returns NOENT to all queries in
lfsr_rbyd_lookup.
This commit is contained in:
Christopher Haster
2023-08-01 11:40:00 -05:00
parent 18e1eb0b41
commit d8d8d1e2ac
3 changed files with 100 additions and 104 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ code = '''
lfsr_mdir_t mdir;
lfsr_mtree_lookup(&lfs, mid, -1, &mdir) => 0;
for (mdir.rid = 0;
mdir.rid < (lfs_ssize_t)lfsr_mdir_weight(&mdir);
mdir.rid < (lfs_ssize_t)mdir.m.rbyd.weight;
mdir.rid++) {
uint8_t buffer[4];
lfsr_mdir_get(&lfs, &mdir, mdir.rid, LFSR_TAG_INLINED,