Renamed fcksum -> ecksum

This checksum is used to keep track of if we have erased, and not yet
touched, the unused bytes trailing our current commit in the rbyd.

The working theory is that if any prog attempt is made, it will, most
likely, change the checksum of the contents, allowing littlefs to
determine if trailing erased-state is safe to use, even under powerloss.
littlefs can also perturb future data by a single bit, to force this
checksum to always be invalidated during normal operation.

The original name, "forward erased-state checksums (fcksum)", came from the
idea that the checksum "looks forward" into the next commit.

But after using them for a bit, I think the name is unnecessarily
confusing. It, uh, also looks a lot like a swear word. I think
shortening the name to just "erased-state checksums (ecksum)", even
though the previous name is already in use in  a release, is reasonable.

---

It's probably hard to believe but the name change from fcrc -> ecrc
really was unrelated to the crc -> cksum change. But boy is it
convenient for avoiding an awkward name. A lot of these name changes
involved sed scripts, so I didn't notice how awkward fcksum would be to
use until writing this commit message.
This commit is contained in:
Christopher Haster
2023-08-07 13:43:07 -05:00
parent 7031d6e1b3
commit d2f2b53262
8 changed files with 447 additions and 447 deletions
+86 -86
View File
@@ -66,7 +66,7 @@ code = '''
for (lfs_size_t i = 0; i < N; i++) {
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(i), 0, &alphas[i % 26], 1))) => 0;
@@ -164,7 +164,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -238,7 +238,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -312,7 +312,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -330,7 +330,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mdir to compact
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// assert mdir was split correctly
@@ -412,8 +412,8 @@ code = '''
for (lfs_size_t i = 0; i < N; i++) {
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.off = CFG->block_size;
lfs.mroot.u.r.rbyd.off = CFG->block_size;
mdir.u.r.rbyd.eoff = CFG->block_size;
lfs.mroot.u.r.rbyd.eoff = CFG->block_size;
}
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
@@ -508,8 +508,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.off = CFG->block_size;
lfs.mroot.u.r.rbyd.off = CFG->block_size;
mdir.u.r.rbyd.eoff = CFG->block_size;
lfs.mroot.u.r.rbyd.eoff = CFG->block_size;
}
// add to rbyd, potentially splitting the mdir
@@ -609,7 +609,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -679,7 +679,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -693,7 +693,7 @@ code = '''
assert(mdir.u.m.weight == 1);
// force mdir to compact while we're removing
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(0, UNR, -1, NULL, 0))) => 0;
@@ -752,7 +752,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
// remove the entry as we compact, forcing the mdir to be dropped
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -812,7 +812,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
// remove the left entry as we compact, forcing the left
// mdir to be dropped
@@ -880,7 +880,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
// remove the right entry as we compact, forcing the right mdir
// to be dropped
@@ -948,7 +948,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
// remove both entries as we compact, forcing both mdirs to be dropped
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -999,7 +999,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -1017,7 +1017,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mdir to compact
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
// remove the left entry as we compact, forcing the left
// mdir to be dropped
@@ -1094,7 +1094,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -1112,7 +1112,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mdir to compact
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
// remove the right entry as we compact, forcing the right
// mdir to be dropped
@@ -1189,7 +1189,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -1207,7 +1207,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mdir to compact
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
// remove both entries as we compact, forcing both mdirs to be dropped
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
@@ -1289,8 +1289,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.off = CFG->block_size;
lfs.mroot.u.r.rbyd.off = CFG->block_size;
mdir.u.r.rbyd.eoff = CFG->block_size;
lfs.mroot.u.r.rbyd.eoff = CFG->block_size;
}
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
@@ -1410,8 +1410,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.off = CFG->block_size;
lfs.mroot.u.r.rbyd.off = CFG->block_size;
mdir.u.r.rbyd.eoff = CFG->block_size;
lfs.mroot.u.r.rbyd.eoff = CFG->block_size;
}
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
@@ -1471,8 +1471,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.off = CFG->block_size;
lfs.mroot.u.r.rbyd.off = CFG->block_size;
mdir.u.r.rbyd.eoff = CFG->block_size;
lfs.mroot.u.r.rbyd.eoff = CFG->block_size;
}
// create
@@ -1594,7 +1594,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mtree has one mdir
@@ -1609,9 +1609,9 @@ code = '''
lfsr_mdir_t old_mdir = mdir;
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[2 % 26], SIZE);
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(0, INLINED, 0, buffer, SIZE))) => 0;
@@ -1689,7 +1689,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -1704,9 +1704,9 @@ code = '''
lfsr_mdir_t old_mdir = mdir;
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[2 % 26], SIZE);
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(0, INLINED, 0, buffer, SIZE))) => 0;
@@ -1784,7 +1784,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -1799,9 +1799,9 @@ code = '''
lfsr_mdir_t old_mdir = mdir;
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[2 % 26], SIZE);
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(0, INLINED, 0, buffer, SIZE))) => 0;
@@ -1877,9 +1877,9 @@ code = '''
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[1 % 26], SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0;
@@ -1938,10 +1938,10 @@ code = '''
lfsr_mdir_t old_mroot = lfs.mroot;
for (int i = 0; i < 4; i++) {
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
}
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[1 % 26], SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0;
@@ -1996,9 +1996,9 @@ code = '''
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert we relocated
@@ -2007,9 +2007,9 @@ code = '''
// force mroot to compact twice again, this should relocate the mroot
old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[1 % 26], SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0;
@@ -2067,7 +2067,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mtree has one mdir
@@ -2077,7 +2077,7 @@ code = '''
// setup mroot to need to compact, this should trigger a relocation when
// we relocate the mdir below
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_t old_mroot = lfs.mroot;
// force mdir to compact twice, this should relocate
@@ -2087,9 +2087,9 @@ code = '''
lfsr_mdir_t old_mdir = mdir;
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[2 % 26], SIZE);
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(0, INLINED, 0, buffer, SIZE))) => 0;
@@ -2173,7 +2173,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -2183,7 +2183,7 @@ code = '''
// setup mroot to need to compact, this should trigger a relocation when
// we relocate the mdir below
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_t old_mroot = lfs.mroot;
// now add another large entry to the mdir, forcing a split
@@ -2196,7 +2196,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mdir to compact
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// assert mdir was split correctly
@@ -2287,7 +2287,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -2297,7 +2297,7 @@ code = '''
// setup mroot to need to compact, this should trigger a relocation when
// we relocate the mdir below
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_t old_mroot = lfs.mroot;
// remove the entry, forcing the mdir to be dropped
@@ -2361,7 +2361,7 @@ code = '''
// force mroot to compact once, so the second compact below will trigger
// a relocation
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// prepare mroot with a large attr so the next entry can not fit
@@ -2377,7 +2377,7 @@ code = '''
// force mroot to compact, this should trigger a relocation
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -2450,7 +2450,7 @@ code = '''
// force mroot to compact once, so the second compact below will trigger
// a relocation
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// create 2 large entries that needs to be uninlined and split
@@ -2465,7 +2465,7 @@ code = '''
// force mroot to compact, this should trigger a relocation
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -2559,8 +2559,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.off = CFG->block_size;
lfs.mroot.u.r.rbyd.off = CFG->block_size;
mdir.u.r.rbyd.eoff = CFG->block_size;
lfs.mroot.u.r.rbyd.eoff = CFG->block_size;
}
// create
@@ -2853,7 +2853,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -2936,7 +2936,7 @@ code = '''
LFSR_ATTR(2, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -3001,7 +3001,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -3037,7 +3037,7 @@ code = '''
LFSR_ATTR(2, INLINED, +1, buffer, SIZE))) => 0;
// force mdir to compact
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// assert mdir was split correctly
@@ -3120,9 +3120,9 @@ code = '''
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[1 % 26], SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0;
@@ -3179,7 +3179,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -3212,9 +3212,9 @@ code = '''
// force mdir to compact twice, this should relocate
lfsr_mdir_t old_mdir = mdir;
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[4 % 26], SIZE);
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(1, INLINED, 0, buffer, SIZE))) => 0;
@@ -3278,7 +3278,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// we should now have 2 mdirs
@@ -3293,7 +3293,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mdir to compact
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// we should now have 3 mdirs
@@ -3324,7 +3324,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mdir to compact
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// we should now have 4 mdirs
@@ -3375,7 +3375,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// we should now have 2 mdirs
@@ -3390,7 +3390,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mdir to compact
mdir.u.r.rbyd.off = BLOCK_SIZE;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// we should now have 3 mdirs
@@ -3572,7 +3572,7 @@ code = '''
LFSR_ATTR(0, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -3707,7 +3707,7 @@ code = '''
LFSR_ATTR(1, INLINED, +1, buffer, SIZE))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -3843,9 +3843,9 @@ code = '''
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[1 % 26], SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0;
@@ -3960,8 +3960,8 @@ code = '''
for (lfs_size_t i = 0; i < N; i++) {
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.off = CFG->block_size;
lfs.mroot.u.r.rbyd.off = CFG->block_size;
mdir.u.r.rbyd.eoff = CFG->block_size;
lfs.mroot.u.r.rbyd.eoff = CFG->block_size;
}
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
@@ -4116,8 +4116,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.off = CFG->block_size;
lfs.mroot.u.r.rbyd.off = CFG->block_size;
mdir.u.r.rbyd.eoff = CFG->block_size;
lfs.mroot.u.r.rbyd.eoff = CFG->block_size;
}
// add to rbyd, potentially splitting the mdir
@@ -4358,9 +4358,9 @@ code = '''
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[1 % 26], SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0;
@@ -4414,10 +4414,10 @@ code = '''
lfsr_mdir_t old_mroot = lfs.mroot;
for (int i = 0; i < 4; i++) {
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
}
lfs.mroot.u.r.rbyd.off = BLOCK_SIZE;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
memset(buffer, alphas[1 % 26], SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, buffer, SIZE))) => 0;