mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-10-29 19:47:49 +00:00
Attempted to implement per-btree leaf caches
The idea here, is we give each lfsr_btree_t an optional leaf rbyd, in
addition to the root rbyd. This leaf rbyd acts as a cache for the most
recent leaf, allowing nearby btree lookups to skip the full btree walk.
Unfortunately, this failed on pretty much every measurable metric...
---
The motivation for this is that we often do a bunch of nearby btree
lookups:
- Btree iteration via lfsr_btree_lookupnext is a bit naive, walking from
the root every step.
- Our crystallization algorithm requires a bunch of nearby lookups to
figure out our crystallization heuristic. Currently at most 4, when
you need to lookup both crystal neighbors and then _also_ both
fragment neighbors for coalescing.
- Checksum collision resolution for dids and (FUTURE) ddkeys can require
an unbounded number of sequential lookups.
Though to be fair, this is an exceptional case if our checksum is any
good.
- Bids with multiple rattrs require nearby lookups to resolve.
Though currently this can be explicitly avoided via
lfsr_btree_lookupleaf + lfsr_rbyd_lookup.
The theory was that cases like these could explicitly keep track of the
leaf rbyd to avoid full btree walks, but in practice this never really
worked out. Tracking if we're still in the relevant leaf rbyd just adds
too much logic/code cost.
But if this leaf tracking logic was implemented once in the btree
layer...
The other theoretical benefit was being able to move more rbyds off the
stack. Sure our btrees take up more RAM, but if that results in stack
savings, that may be a win.
Oh, and this would let our btree API and rbyd API converge without
performance concerns. Internal users could in theory call
lfsr_btree_lookupnext + lfsr_btree_lookup with the same performance as
explicitly tracking the rbyd.
---
But this was a complete failure!
First the good news: There was a modest speedup of around ~2x to linear
reads.
And that's the good news.
Now the bad news:
1. There was no noticeable performance gain in any other benchmarks.
To be fair, we're at the early stages of benchmarking, so the
benchmarks may not be the most thorough, but thinking about it, there
are some explanations:
- In any benchmark that writes, fetch + erase + prog dominates. Being
able to skip fetches during lookups makes our btree lookups
surprisingly cheap!
- Any random read heavy benchmark is likely thrashing this cache,
which is to be expected.
- For small 1-block btrees, the leaf cache is useless because the
entire btree is cache in the root rbyd.
And keep in mind, our blocks are BIG. "Small" here could be on
the order of ~128KiB-1MiB for NAND flash.
- For the mtree, fetched mdirs actually already act as a sort of leaf
cache.
The extra btree leaf cache isn't doing _nothing_, but each layer of
the mtree has diminishing returns due to btree's ridiculous
branching factor.
- For file btrees, we're explicitly caching the leaf fragments/
blocks, so the extra btree leaf cache has diminishing returns for
the same reason.
2. Code cost was bad, stack cost was worse:
code stack ctx
before: 37172 2288 636
after: 38068 (+2.4%) 2416 (+5.6%) 664 (+4.4%)
Tracking the leaf required more code, that's expected. And, to be
fair, the current code has had a lot more time to congeal.
What wasn't expected was the stack cost.
Unfortunately these caches didn't really take any rbyds off the stack
hot-path:
- We _can_ get rid of the rbyd in lfsr_btree_lookup/namelookup, but
we were already hacking our way around the critical one in
lfsr_mtree_lookup/namelookup by reusing the mdir's rbyd!
- We can't even abuse the leaf rbyd in the commit logic, since the
target btree can end up iterated/traversed by lfs_alloc.
That was a fun bug.
And the addition of a second rbyd to lfsr_btree_t increases both ctx
and stack anywhere btrees are allocated.
Maybe this will make more sense when we add the auxiliary btrees, or
after more benchmarking, but for now the theoretical performance
improvements just aren't worth it.
Will probably revert this, but I wanted to commit it in case the idea is
worth resurrecting in the future, if in the future nearby btree lookups
are a bigger penalty than they are now.
This commit is contained in:
parent
aaefad11e3
commit
a49e13b992
13
lfs.h
13
lfs.h
@ -681,8 +681,15 @@ typedef struct lfsr_rbyd {
|
||||
uint32_t cksum;
|
||||
} lfsr_rbyd_t;
|
||||
|
||||
// a btree is represented by the root rbyd
|
||||
typedef lfsr_rbyd_t lfsr_btree_t;
|
||||
// all we need for btrees is the root rbyd, but tracking the most recent
|
||||
// leaf helps speed up iteration/attr lookup/etc
|
||||
typedef struct lfsr_btree {
|
||||
lfsr_rbyd_t root;
|
||||
struct {
|
||||
lfsr_bid_t bid;
|
||||
lfsr_rbyd_t rbyd;
|
||||
} leaf;
|
||||
} lfsr_btree_t;
|
||||
|
||||
// littlefs's atomic metadata log type
|
||||
typedef struct lfsr_mdir {
|
||||
@ -709,7 +716,7 @@ typedef struct lfsr_bshrub {
|
||||
// trunk=0 => no bshrub/btree
|
||||
// sign(trunk)=1 => bshrub
|
||||
// sign(trunk)=0 => btree
|
||||
lfsr_shrub_t shrub;
|
||||
lfsr_btree_t shrub;
|
||||
lfsr_shrub_t shrub_;
|
||||
} lfsr_bshrub_t;
|
||||
|
||||
|
||||
@ -98,10 +98,10 @@ code = '''
|
||||
}
|
||||
printf("]\n");
|
||||
printf("btree: w%d 0x%x.%x\n",
|
||||
btree.weight,
|
||||
btree.blocks[0],
|
||||
btree.trunk);
|
||||
assert(btree.weight == sim_size);
|
||||
lfsr_btree_weight(&btree),
|
||||
lfsr_btree_block(&btree),
|
||||
lfsr_btree_trunk(&btree));
|
||||
assert(lfsr_btree_weight(&btree) == sim_size);
|
||||
|
||||
uint8_t buffer[4];
|
||||
lfsr_bid_t bid_;
|
||||
@ -2053,10 +2053,10 @@ code = '''
|
||||
}
|
||||
printf("]\n");
|
||||
printf("btree: w%d 0x%x.%x\n",
|
||||
btree.weight,
|
||||
btree.blocks[0],
|
||||
btree.trunk);
|
||||
assert(btree.weight == sim_size);
|
||||
lfsr_btree_weight(&btree),
|
||||
lfsr_btree_block(&btree),
|
||||
lfsr_btree_trunk(&btree));
|
||||
assert(lfsr_btree_weight(&btree) == sim_size);
|
||||
|
||||
uint8_t buffer[4];
|
||||
lfsr_bid_t bid_;
|
||||
@ -4010,10 +4010,10 @@ code = '''
|
||||
}
|
||||
printf("]\n");
|
||||
printf("btree: w%d 0x%x.%x\n",
|
||||
btree.weight,
|
||||
btree.blocks[0],
|
||||
btree.trunk);
|
||||
assert(btree.weight == sim_size);
|
||||
lfsr_btree_weight(&btree),
|
||||
lfsr_btree_block(&btree),
|
||||
lfsr_btree_trunk(&btree));
|
||||
assert(lfsr_btree_weight(&btree) == sim_size);
|
||||
|
||||
uint8_t buffer[4];
|
||||
lfsr_bid_t bid_;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -1227,10 +1227,10 @@ code = '''
|
||||
|
||||
// create an empty btree
|
||||
lfs_alloc_ckpoint(&lfs);
|
||||
lfsr_rbyd_alloc(&lfs, &file.b.shrub) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &file.b.shrub, 0, LFSR_RATTRS(
|
||||
lfsr_rbyd_alloc(&lfs, &file.b.shrub.root) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &file.b.shrub.root, 0, LFSR_RATTRS(
|
||||
LFSR_RATTR_BUF(LFSR_TAG_DATA, +1, "?", 1))) => 0;
|
||||
lfsr_rbyd_commit(&lfs, &file.b.shrub, 0, LFSR_RATTRS(
|
||||
lfsr_rbyd_commit(&lfs, &file.b.shrub.root, 0, LFSR_RATTRS(
|
||||
LFSR_RATTR(LFSR_TAG_RM, -1))) => 0;
|
||||
lfsr_mdir_commit(&lfs, &file.b.o.mdir, LFSR_RATTRS(
|
||||
LFSR_RATTR_BTREE(
|
||||
|
||||
@ -196,7 +196,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(3), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -220,7 +220,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdirs were unininlined
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -281,7 +281,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -307,7 +307,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -370,7 +370,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -390,7 +390,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(2), 0, "e", 1))) => 0;
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (3 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (3 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -426,7 +426,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (3 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (3 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -687,7 +687,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -700,7 +700,7 @@ code = '''
|
||||
assert(mdir.rbyd.weight == 0);
|
||||
|
||||
// assert mdir was dropped
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -720,7 +720,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdir was dropped
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -777,7 +777,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -792,7 +792,7 @@ code = '''
|
||||
assert(mdir.rbyd.weight == 0);
|
||||
|
||||
// assert mdir was dropped
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -812,7 +812,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdir was dropped
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -875,7 +875,7 @@ code = '''
|
||||
assert(mdir.rbyd.weight == 2);
|
||||
|
||||
// assert split/drop worked out
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -891,7 +891,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdir was dropped
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -944,7 +944,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -969,7 +969,7 @@ code = '''
|
||||
assert(mdir.rbyd.weight == 1);
|
||||
|
||||
// assert split/drop worked out
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -995,7 +995,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert split/drop worked out
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1058,7 +1058,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1083,7 +1083,7 @@ code = '''
|
||||
assert(mdir.rbyd.weight == 1);
|
||||
|
||||
// assert split/drop worked out
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1109,7 +1109,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert split/drop worked out
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1296,7 +1296,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(3), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1313,7 +1313,7 @@ code = '''
|
||||
assert(lfsr_mdir_cmp(&old_mdir, &mdir) != 0);
|
||||
|
||||
// assert mdirs were unininlined
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1347,7 +1347,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdirs were unininlined
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1420,7 +1420,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1439,7 +1439,7 @@ code = '''
|
||||
assert(lfsr_mdir_cmp(&old_mdir, &mdir) != 0);
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1475,7 +1475,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1550,7 +1550,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1569,7 +1569,7 @@ code = '''
|
||||
assert(lfsr_mdir_cmp(&old_mdir, &mdir) != 0);
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1605,7 +1605,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -1982,7 +1982,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2006,7 +2006,7 @@ code = '''
|
||||
assert(lfsr_mdir_cmp(&old_mroot, &lfs.mroot) != 0);
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2042,7 +2042,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2117,7 +2117,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2148,7 +2148,7 @@ code = '''
|
||||
assert(lfsr_mdir_cmp(&old_mroot, &lfs.mroot) != 0);
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (3 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (3 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2188,7 +2188,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (3 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (3 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2267,7 +2267,7 @@ code = '''
|
||||
LFSR_RATTR_BUF(LFSR_TAG_ATTR(1), 0, "c", 1))) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2291,7 +2291,7 @@ code = '''
|
||||
assert(lfsr_mdir_cmp(&old_mroot, &lfs.mroot) != 0);
|
||||
|
||||
// assert mdir was dropped
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2311,7 +2311,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdir was dropped
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2368,7 +2368,7 @@ code = '''
|
||||
assert(lfsr_mdir_cmp(&old_mroot, &lfs.mroot) != 0);
|
||||
|
||||
// assert mdirs were unininlined
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2392,7 +2392,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdirs were unininlined
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2463,7 +2463,7 @@ code = '''
|
||||
assert(lfsr_mdir_cmp(&old_mroot, &lfs.mroot) != 0);
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2489,7 +2489,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2888,7 +2888,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -2979,7 +2979,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (3 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (3 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3114,7 +3114,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3211,7 +3211,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3320,7 +3320,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (3 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (3 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3339,7 +3339,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (4 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (4 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3430,7 +3430,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (3 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (3 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3440,7 +3440,7 @@ code = '''
|
||||
assert(mdir.rbyd.weight == 0);
|
||||
|
||||
// assert mdir was dropped correctly
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3597,7 +3597,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
|
||||
|
||||
// assert mdirs were unininlined
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3663,7 +3663,7 @@ code = '''
|
||||
// and the tree should still work
|
||||
|
||||
// assert mdirs were unininlined
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3683,7 +3683,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdirs were unininlined
|
||||
assert(lfs.mtree.weight == (1 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (1 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3740,7 +3740,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3806,7 +3806,7 @@ code = '''
|
||||
// and the tree should still work
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3828,7 +3828,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3887,7 +3887,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
|
||||
|
||||
// assert mdirs were unininlined and split
|
||||
assert(lfs.mtree.weight == (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (2 << lfs.mbits));
|
||||
// assert mroot now has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3906,7 +3906,7 @@ code = '''
|
||||
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (3 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (3 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -3972,7 +3972,7 @@ code = '''
|
||||
// and the tree should still work
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (3 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (3 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
@ -4000,7 +4000,7 @@ code = '''
|
||||
lfsr_mount(&lfs, LFS_M_RDWR | M_FLAGS, CFG) => 0;
|
||||
|
||||
// assert mdir was split correctly
|
||||
assert(lfs.mtree.weight == (3 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight == (3 << lfs.mbits));
|
||||
// assert mroot still has no entries
|
||||
assert(lfs.mroot.rbyd.weight == 0);
|
||||
|
||||
|
||||
@ -3416,7 +3416,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "uloborus%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -3535,7 +3535,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "uloborus%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -3662,7 +3662,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "uloborus%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4186,7 +4186,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split twice
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "tarantula%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4196,8 +4196,8 @@ code = '''
|
||||
}
|
||||
|
||||
i = 0;
|
||||
lfs_size_t orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
lfs_size_t orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "xnotata%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4221,8 +4221,8 @@ code = '''
|
||||
|
||||
// create enough files for mdir to split again
|
||||
i = 0;
|
||||
orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "vulsor%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4361,7 +4361,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split twice
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "tarantula%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4371,8 +4371,8 @@ code = '''
|
||||
}
|
||||
|
||||
i = 0;
|
||||
lfs_size_t orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
lfs_size_t orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "xnotata%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4420,8 +4420,8 @@ code = '''
|
||||
|
||||
// create enough files for mdir to split again
|
||||
i = 0;
|
||||
orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "vulsor%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4543,7 +4543,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split twice
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "tarantula%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4553,8 +4553,8 @@ code = '''
|
||||
}
|
||||
|
||||
i = 0;
|
||||
lfs_size_t orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
lfs_size_t orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "xnotata%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4607,8 +4607,8 @@ code = '''
|
||||
|
||||
// create enough files for mdir to split again
|
||||
i = 0;
|
||||
orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "vulsor%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4719,7 +4719,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split twice
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "tarantula%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4729,8 +4729,8 @@ code = '''
|
||||
}
|
||||
|
||||
i = 0;
|
||||
lfs_size_t orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
lfs_size_t orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "xnotata%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4892,7 +4892,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split twice
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "tarantula%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -4902,8 +4902,8 @@ code = '''
|
||||
}
|
||||
|
||||
i = 0;
|
||||
lfs_size_t orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
lfs_size_t orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "xnotata%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -5083,7 +5083,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split twice
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "tarantula%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -5093,8 +5093,8 @@ code = '''
|
||||
}
|
||||
|
||||
i = 0;
|
||||
lfs_size_t orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
lfs_size_t orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "xnotata%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -5262,7 +5262,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split twice
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "tarantula%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -5272,8 +5272,8 @@ code = '''
|
||||
}
|
||||
|
||||
i = 0;
|
||||
lfs_size_t orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
lfs_size_t orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "xnotata%03x", i);
|
||||
lfsr_file_open(&lfs, &file, name,
|
||||
@ -5795,7 +5795,7 @@ code = '''
|
||||
lfs_size_t i = 0;
|
||||
while (true) {
|
||||
// we should not have split yet
|
||||
assert(lfs.mtree.weight == 0);
|
||||
assert(lfs.mtree.root.weight == 0);
|
||||
// we need internals to check this
|
||||
lfs_ssize_t estimate = lfsr_mdir_estimate__(&lfs,
|
||||
&file1.b.o.mdir, -1, -1,
|
||||
@ -5964,7 +5964,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split twice
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "hydroid%03x", i);
|
||||
lfsr_file_t file;
|
||||
@ -5975,8 +5975,8 @@ code = '''
|
||||
}
|
||||
|
||||
i = 0;
|
||||
lfs_size_t orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
lfs_size_t orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "medusa%03x", i);
|
||||
lfsr_file_t file;
|
||||
@ -6198,7 +6198,7 @@ code = '''
|
||||
|
||||
// create enough files for mroot to split twice
|
||||
lfs_size_t i = 0;
|
||||
while (lfs.mtree.weight == 0) {
|
||||
while (lfs.mtree.root.weight == 0) {
|
||||
char name[256];
|
||||
sprintf(name, "hydroid%03x", i);
|
||||
lfsr_file_t file;
|
||||
@ -6209,8 +6209,8 @@ code = '''
|
||||
}
|
||||
|
||||
i = 0;
|
||||
lfs_size_t orig = lfs.mtree.weight;
|
||||
while (lfs.mtree.weight == orig) {
|
||||
lfs_size_t orig = lfs.mtree.root.weight;
|
||||
while (lfs.mtree.root.weight == orig) {
|
||||
char name[256];
|
||||
sprintf(name, "polyp%03x", i);
|
||||
lfsr_file_t file;
|
||||
@ -6222,10 +6222,10 @@ code = '''
|
||||
|
||||
// create enough files to both compact and split
|
||||
i = 0;
|
||||
orig = lfs.mtree.weight;
|
||||
orig = lfs.mtree.root.weight;
|
||||
while (true) {
|
||||
// we should not have split yet
|
||||
assert(lfs.mtree.weight == orig);
|
||||
assert(lfs.mtree.root.weight == orig);
|
||||
// we need internals to check this
|
||||
lfs_ssize_t estimate = lfsr_mdir_estimate__(&lfs,
|
||||
&file2.b.o.mdir, -1, -1,
|
||||
@ -6482,7 +6482,7 @@ code = '''
|
||||
assert(!(lfs.flags & LFS_I_MKCONSISTENT));
|
||||
|
||||
// which means there shouldn't be that many files left
|
||||
assert(lfs.mtree.weight <= (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight <= (2 << lfs.mbits));
|
||||
assert(file1.b.o.mdir.rbyd.weight <= 3);
|
||||
assert(file2.b.o.mdir.rbyd.weight <= 3);
|
||||
|
||||
@ -6783,7 +6783,7 @@ code = '''
|
||||
assert(!(lfs.flags & LFS_I_MKCONSISTENT));
|
||||
|
||||
// which means there shouldn't be that many files left
|
||||
assert(lfs.mtree.weight <= (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight <= (2 << lfs.mbits));
|
||||
assert(file1.b.o.mdir.rbyd.weight <= 3);
|
||||
assert(file2.b.o.mdir.rbyd.weight <= 3);
|
||||
|
||||
@ -6943,7 +6943,7 @@ code = '''
|
||||
assert(!(lfs.flags & LFS_I_MKCONSISTENT));
|
||||
|
||||
// which means there shouldn't be that many files left
|
||||
assert(lfs.mtree.weight <= (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight <= (2 << lfs.mbits));
|
||||
assert(file1.b.o.mdir.rbyd.weight <= 3);
|
||||
assert(file2.b.o.mdir.rbyd.weight <= 3);
|
||||
|
||||
@ -7112,7 +7112,7 @@ code = '''
|
||||
assert(!(lfs.flags & LFS_I_MKCONSISTENT));
|
||||
|
||||
// which means there shouldn't be that many files left
|
||||
assert(lfs.mtree.weight <= (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight <= (2 << lfs.mbits));
|
||||
assert(file1.b.o.mdir.rbyd.weight <= 3);
|
||||
assert(file2.b.o.mdir.rbyd.weight <= 3);
|
||||
|
||||
@ -7281,7 +7281,7 @@ code = '''
|
||||
assert(!(lfs.flags & LFS_I_MKCONSISTENT));
|
||||
|
||||
// which means there shouldn't be that many files left
|
||||
assert(lfs.mtree.weight <= (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight <= (2 << lfs.mbits));
|
||||
assert(file1.b.o.mdir.rbyd.weight <= 3);
|
||||
assert(file2.b.o.mdir.rbyd.weight <= 3);
|
||||
|
||||
@ -7446,7 +7446,7 @@ code = '''
|
||||
assert(!(lfs.flags & LFS_I_MKCONSISTENT));
|
||||
|
||||
// which means there shouldn't be that many files left
|
||||
assert(lfs.mtree.weight <= (2 << lfs.mbits));
|
||||
assert(lfs.mtree.root.weight <= (2 << lfs.mbits));
|
||||
assert(file1.b.o.mdir.rbyd.weight <= 3);
|
||||
assert(file2.b.o.mdir.rbyd.weight <= 3);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user