Dropped single-letter union variants, prefer descriptive names

This is in an effort to make the codebase a _bit_ more readable, but
these structs are ending up a complete mess.
This commit is contained in:
Christopher Haster
2023-09-22 12:08:08 -05:00
parent 93ee9d49cf
commit da2a4b45f7
4 changed files with 489 additions and 492 deletions
+215 -215
View File
@@ -116,9 +116,9 @@ code = '''
// create an empty tree
lfsr_btree_t btree = LFSR_BTREE_NULL;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 0);
// try looking up tags
@@ -149,9 +149,9 @@ code = '''
lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
LFSR_DATA("a", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 1);
// try looking up tags
@@ -190,9 +190,9 @@ code = '''
lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
LFSR_DATA("b", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 2);
// try looking up tags
@@ -236,9 +236,9 @@ code = '''
lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
LFSR_DATA("a", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 2);
// try looking up tags
@@ -285,9 +285,9 @@ code = '''
lfsr_btree_push(&lfs, &btree, 2, LFSR_TAG_INLINED, 1,
LFSR_DATA("c", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 3);
// try looking up tags
@@ -339,9 +339,9 @@ code = '''
lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
LFSR_DATA("a", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 3);
// try looking up tags
@@ -402,9 +402,9 @@ code = '''
n += 1;
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == n);
// check that the elements are in the tree
@@ -454,9 +454,9 @@ code = '''
n += 1;
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == n);
// check that the elements are in the tree
@@ -537,9 +537,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == sim_size);
uint8_t buffer[4];
@@ -592,9 +592,9 @@ code = '''
n += 1;
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == n*W);
// check that the elements are in the tree
@@ -713,9 +713,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
lfs_size_t total_weight = 0;
for (lfs_size_t j = 0; j < sim_size; j++) {
@@ -795,9 +795,9 @@ code = '''
lfsr_btree_set(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
LFSR_DATA("A", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 1);
// try looking up tags
@@ -840,9 +840,9 @@ code = '''
lfsr_btree_set(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
LFSR_DATA("B", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 2);
// try looking up tags
@@ -895,9 +895,9 @@ code = '''
lfsr_btree_set(&lfs, &btree, 2, LFSR_TAG_INLINED, 1,
LFSR_DATA("C", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 3);
// try looking up tags
@@ -951,9 +951,9 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
@@ -965,17 +965,17 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == N);
// check that the elements are in the tree
@@ -1023,9 +1023,9 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
@@ -1070,9 +1070,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == N);
uint8_t buffer[4];
@@ -1119,9 +1119,9 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
@@ -1133,17 +1133,17 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == N*W);
// check that the elements are in the tree
@@ -1207,9 +1207,9 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
@@ -1273,9 +1273,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
lfs_size_t total_weight = 0;
for (lfs_size_t j = 0; j < N; j++) {
@@ -1355,9 +1355,9 @@ code = '''
// pop!
lfsr_btree_pop(&lfs, &btree, 0) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 0);
// try looking up tags
@@ -1372,9 +1372,9 @@ code = '''
lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
LFSR_DATA("A", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 1);
// try looking up tags
@@ -1410,9 +1410,9 @@ code = '''
// pop!
lfsr_btree_pop(&lfs, &btree, 1) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 1);
// try looking up tags
@@ -1433,9 +1433,9 @@ code = '''
lfsr_btree_push(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
LFSR_DATA("B", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 2);
// try looking up tags
@@ -1477,9 +1477,9 @@ code = '''
// pop!
lfsr_btree_pop(&lfs, &btree, 0) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 1);
// try looking up tags
@@ -1500,9 +1500,9 @@ code = '''
lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
LFSR_DATA("A", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 2);
// try looking up tags
@@ -1546,9 +1546,9 @@ code = '''
// pop!
lfsr_btree_pop(&lfs, &btree, 2) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 2);
// try looking up tags
@@ -1575,9 +1575,9 @@ code = '''
lfsr_btree_push(&lfs, &btree, 2, LFSR_TAG_INLINED, 1,
LFSR_DATA("C", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 3);
// try looking up tags
@@ -1628,9 +1628,9 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
@@ -1641,18 +1641,18 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == REMAINING);
// check that the elements are in the tree
@@ -1719,9 +1719,9 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
@@ -1732,17 +1732,17 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == REMAINING);
// check that the elements are in the tree
@@ -1811,9 +1811,9 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
@@ -1859,9 +1859,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == sim_size);
uint8_t buffer[4];
@@ -1909,9 +1909,9 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
@@ -1922,17 +1922,17 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == REMAINING*W);
// check that the elements are in the tree
@@ -2049,9 +2049,9 @@ code = '''
// ignore space issues
if (err == LFS_ERR_NOSPC) {
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
return;
}
assert(err == 0);
@@ -2106,9 +2106,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
lfs_size_t total_weight = 0;
for (lfs_size_t j = 0; j < sim_size; j++) {
@@ -2197,9 +2197,9 @@ code = '''
n += 1;
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == n);
// check that the elements are in the tree
@@ -2286,9 +2286,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == sim_size);
uint8_t buffer[4];
@@ -2344,9 +2344,9 @@ code = '''
n += 1;
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == n*W);
// check that the elements are in the tree
@@ -2484,9 +2484,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
lfs_size_t total_weight = 0;
for (lfs_size_t j = 0; j < sim_size; j++) {
@@ -2575,7 +2575,7 @@ code = '''
LFSR_TAG_INLINED, 1, LFSR_DATA(buf1, SIZE),
LFSR_TAG_INLINED, 1, LFSR_DATA(buf2, SIZE)) => 0;
// force compaction
btree.u.r.rbyd.eoff = -1;
btree.u.rbyd.eoff = -1;
memset(buf2, 'b', SIZE);
lfsr_btree_set(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
LFSR_DATA(buf2, SIZE)) => 0;
@@ -2586,9 +2586,9 @@ code = '''
lfsr_btree_pop(&lfs, &btree, SIBLING) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 1);
// check that our other entry is fine
@@ -2637,7 +2637,7 @@ code = '''
LFSR_TAG_INLINED, 1, LFSR_DATA(buf1, SIZE),
LFSR_TAG_INLINED, 1, LFSR_DATA(buf2, SIZE)) => 0;
// force compaction
btree.u.r.rbyd.eoff = -1;
btree.u.rbyd.eoff = -1;
memset(buf2, 'b', SIZE);
lfsr_btree_set(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
LFSR_DATA(buf2, SIZE)) => 0;
@@ -2647,13 +2647,13 @@ code = '''
// this should force one of the blocks to drop
//
// do this while forcing a compaction
btree.u.r.rbyd.eoff = -1;
btree.u.rbyd.eoff = -1;
lfsr_btree_pop(&lfs, &btree, SIBLING) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 1);
// check that our other entry is fine
@@ -2707,13 +2707,13 @@ code = '''
//
// messy, isn't it? this is why we need an explicit test
//
btree.u.r.rbyd.eoff = -1;
btree.u.rbyd.eoff = -1;
lfsr_btree_pop(&lfs, &btree, SIBLING) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 1);
// check that our other entry is fine
@@ -2762,7 +2762,7 @@ code = '''
LFSR_TAG_INLINED, 1, LFSR_DATA(buf1, SIZE),
LFSR_TAG_INLINED, 1, LFSR_DATA(buf2, SIZE)) => 0;
// force compaction
btree.u.r.rbyd.eoff = -1;
btree.u.rbyd.eoff = -1;
memset(buf2, 'b', SIZE);
lfsr_btree_set(&lfs, &btree, 1, LFSR_TAG_INLINED, 1,
LFSR_DATA(buf2, SIZE)) => 0;
@@ -2776,13 +2776,13 @@ code = '''
// force compaction, while removing one entry, this drops the rbyd
// down to zero while also triggering a merge
btree.u.r.rbyd.eoff = -1;
btree.u.rbyd.eoff = -1;
lfsr_btree_pop(&lfs, &btree, SIBLING) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 1);
// check that our other entry is fine
@@ -2893,9 +2893,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == sim_size);
uint8_t buffer[4];
@@ -3034,9 +3034,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
lfs_size_t total_weight = 0;
for (lfs_size_t j = 0; j < sim_size; j++) {
@@ -3109,9 +3109,9 @@ code = '''
// create a zero-entry tree
lfsr_btree_t btree = LFSR_BTREE_NULL;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 0);
// try to find tags
@@ -3144,9 +3144,9 @@ code = '''
lfsr_btree_push(&lfs, &btree, 0, LFSR_TAG_INLINED, 1,
LFSR_DATA("0", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 1);
// try to find tags
@@ -3196,9 +3196,9 @@ code = '''
LFSR_TAG_INLINED, 1, LFSR_DATA("0", 1),
LFSR_TAG_INLINED, 1, LFSR_DATA("1", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 2);
// try to find tags
@@ -3259,9 +3259,9 @@ code = '''
LFSR_TAG_INLINED, 1, LFSR_DATA("1", 1),
LFSR_TAG_INLINED, 1, LFSR_DATA("2", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 3);
// try to find tags
@@ -3330,9 +3330,9 @@ code = '''
LFSR_TAG_INLINED, 1, LFSR_DATA("0", 1),
LFSR_TAG_INLINED, 1, LFSR_DATA("1", 1)) => 0;
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == 3);
// try to find tags
@@ -3414,9 +3414,9 @@ code = '''
n += 1;
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == n);
// try to find tags
@@ -3526,9 +3526,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == sim_size);
uint8_t buffer[4];
@@ -3592,9 +3592,9 @@ code = '''
n += 1;
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == n*W);
// try to find tags
@@ -3732,9 +3732,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
lfs_size_t total_weight = 0;
for (lfs_size_t j = 0; j < sim_size; j++) {
@@ -3920,9 +3920,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == sim_size);
uint8_t buffer[4];
@@ -4130,9 +4130,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
lfs_size_t total_weight = 0;
for (lfs_size_t j = 0; j < sim_size; j++) {
@@ -4200,9 +4200,9 @@ code = '''
n += 1;
}
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == n);
// check that the elements are in the tree
@@ -4244,7 +4244,7 @@ code = '''
}
if (tag_ == LFSR_TAG_BTREE) {
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer;
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.buffer.buffer;
printf("traversal: %d 0x%x w%d btree 0x%x.%x\n",
bid_,
tag_,
@@ -4349,9 +4349,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == sim_size);
uint8_t buffer[4];
@@ -4392,7 +4392,7 @@ code = '''
}
if (tag_ == LFSR_TAG_BTREE) {
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer;
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.buffer.buffer;
printf("traversal: %d 0x%x w%d btree 0x%x.%x\n",
bid_,
tag_,
@@ -4435,9 +4435,9 @@ code = '''
}
printf("]\n");
printf("btree: w%d 0x%x.%x\n",
btree.u.r.rbyd.weight,
btree.u.r.rbyd.block,
btree.u.r.rbyd.trunk);
btree.u.rbyd.weight,
btree.u.rbyd.block,
btree.u.rbyd.trunk);
assert(lfsr_btree_weight(&btree) == sim_size);
for (lfs_size_t i = 0; i < sim_size; i++) {
+100 -100
View File
@@ -81,7 +81,7 @@ code = '''
for (lfs_size_t i = 0; i < N; i++) {
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(i), 0, BUF(&alphas[i % 26], 1)))) => 0;
@@ -178,7 +178,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -251,7 +251,7 @@ code = '''
LFSR_ATTR(1, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -324,7 +324,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -342,7 +342,7 @@ code = '''
LFSR_ATTR(mdir.mid, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mdir to compact
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// assert mdir was split correctly
@@ -423,8 +423,8 @@ code = '''
for (lfs_size_t i = 0; i < N; i++) {
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.eoff = -1;
lfs.mroot.u.r.rbyd.eoff = -1;
mdir.u.rbyd.eoff = -1;
lfs.mroot.u.rbyd.eoff = -1;
}
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
@@ -526,8 +526,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.eoff = -1;
lfs.mroot.u.r.rbyd.eoff = -1;
mdir.u.rbyd.eoff = -1;
lfs.mroot.u.rbyd.eoff = -1;
}
// add to rbyd, potentially splitting the mdir
@@ -631,7 +631,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -700,7 +700,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -714,7 +714,7 @@ code = '''
assert(mdir.u.m.weight == 1);
// force mdir to compact while we're removing
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(0, RM, -1, NULL))) => 0;
@@ -772,7 +772,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
// remove the entry as we compact, forcing the mdir to be dropped
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -831,7 +831,7 @@ code = '''
LFSR_ATTR(1, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
// remove the left entry as we compact, forcing the left
// mdir to be dropped
@@ -898,7 +898,7 @@ code = '''
LFSR_ATTR(1, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
// remove the right entry as we compact, forcing the right mdir
// to be dropped
@@ -965,7 +965,7 @@ code = '''
LFSR_ATTR(1, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
// remove both entries as we compact, forcing both mdirs to be dropped
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
@@ -1015,7 +1015,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -1033,7 +1033,7 @@ code = '''
LFSR_ATTR(mdir.mid, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mdir to compact
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
// remove the left entry as we compact, forcing the left
// mdir to be dropped
@@ -1110,7 +1110,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -1128,7 +1128,7 @@ code = '''
LFSR_ATTR(mdir.mid, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mdir to compact
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
// remove the right entry as we compact, forcing the right
// mdir to be dropped
@@ -1204,7 +1204,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -1222,7 +1222,7 @@ code = '''
LFSR_ATTR(mdir.mid, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mdir to compact
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
// remove both entries as we compact, forcing both mdirs to be dropped
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
@@ -1303,8 +1303,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.eoff = -1;
lfs.mroot.u.r.rbyd.eoff = -1;
mdir.u.rbyd.eoff = -1;
lfs.mroot.u.rbyd.eoff = -1;
}
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
@@ -1428,8 +1428,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.eoff = -1;
lfs.mroot.u.r.rbyd.eoff = -1;
mdir.u.rbyd.eoff = -1;
lfs.mroot.u.rbyd.eoff = -1;
}
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
@@ -1491,8 +1491,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.eoff = -1;
lfs.mroot.u.r.rbyd.eoff = -1;
mdir.u.rbyd.eoff = -1;
lfs.mroot.u.rbyd.eoff = -1;
}
// create
@@ -1617,7 +1617,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mtree has one mdir
@@ -1632,9 +1632,9 @@ code = '''
lfsr_mdir_t old_mdir = mdir;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'c', SIZE);
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(mdir.mid, REG, 0, BUF(buffer, SIZE)))) => 0;
@@ -1711,7 +1711,7 @@ code = '''
LFSR_ATTR(1, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -1726,9 +1726,9 @@ code = '''
lfsr_mdir_t old_mdir = mdir;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'c', SIZE);
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(mdir.mid, REG, 0, BUF(buffer, SIZE)))) => 0;
@@ -1805,7 +1805,7 @@ code = '''
LFSR_ATTR(1, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -1820,9 +1820,9 @@ code = '''
lfsr_mdir_t old_mdir = mdir;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'c', SIZE);
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(mdir.mid, REG, 0, BUF(buffer, SIZE)))) => 0;
@@ -1897,9 +1897,9 @@ code = '''
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'b', SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0;
@@ -1957,10 +1957,10 @@ code = '''
lfsr_mdir_t old_mroot = lfs.mroot;
for (int i = 0; i < 4; i++) {
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
}
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'b', SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0;
@@ -2014,9 +2014,9 @@ code = '''
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert we relocated
@@ -2025,9 +2025,9 @@ code = '''
// force mroot to compact twice again, this should relocate the mroot
old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'b', SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0;
@@ -2084,7 +2084,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mtree has one mdir
@@ -2094,7 +2094,7 @@ code = '''
// setup mroot to need to compact, this should trigger a relocation when
// we relocate the mdir below
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_t old_mroot = lfs.mroot;
// force mdir to compact twice, this should relocate
@@ -2104,9 +2104,9 @@ code = '''
lfsr_mdir_t old_mdir = mdir;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'c', SIZE);
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(mdir.mid, REG, 0, BUF(buffer, SIZE)))) => 0;
@@ -2189,7 +2189,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -2199,7 +2199,7 @@ code = '''
// setup mroot to need to compact, this should trigger a relocation when
// we relocate the mdir below
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_t old_mroot = lfs.mroot;
// now add another large entry to the mdir, forcing a split
@@ -2212,7 +2212,7 @@ code = '''
LFSR_ATTR(mdir.mid, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mdir to compact
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// assert mdir was split correctly
@@ -2302,7 +2302,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -2312,7 +2312,7 @@ code = '''
// setup mroot to need to compact, this should trigger a relocation when
// we relocate the mdir below
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_t old_mroot = lfs.mroot;
// remove the entry, forcing the mdir to be dropped
@@ -2375,7 +2375,7 @@ code = '''
// force mroot to compact once, so the second compact below will trigger
// a relocation
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.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
@@ -2391,7 +2391,7 @@ code = '''
// force mroot to compact, this should trigger a relocation
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -2463,7 +2463,7 @@ code = '''
// force mroot to compact once, so the second compact below will trigger
// a relocation
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// create 2 large entries that needs to be uninlined and split
@@ -2478,7 +2478,7 @@ code = '''
// force mroot to compact, this should trigger a relocation
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -2574,8 +2574,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.eoff = -1;
lfs.mroot.u.r.rbyd.eoff = -1;
mdir.u.rbyd.eoff = -1;
lfs.mroot.u.rbyd.eoff = -1;
}
// create
@@ -2860,7 +2860,7 @@ code = '''
LFSR_ATTR(1, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -2938,7 +2938,7 @@ code = '''
LFSR_ATTR(2, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -2998,7 +2998,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -3035,7 +3035,7 @@ code = '''
LFSR_ATTR(mdir.mid, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mdir to compact
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// assert mdir was split correctly
@@ -3113,9 +3113,9 @@ code = '''
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'b', SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0;
@@ -3167,7 +3167,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -3200,9 +3200,9 @@ code = '''
// force mdir to compact twice, this should relocate
lfsr_mdir_t old_mdir = mdir;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'e', SIZE);
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
LFSR_ATTR(1, REG, 0, BUF(buffer, SIZE)))) => 0;
@@ -3261,7 +3261,7 @@ code = '''
LFSR_ATTR(1, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// we should now have 2 mdirs
@@ -3276,7 +3276,7 @@ code = '''
LFSR_ATTR(mdir.mid, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mdir to compact
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// we should now have 3 mdirs
@@ -3307,7 +3307,7 @@ code = '''
LFSR_ATTR(mdir.mid, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mdir to compact
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// we should now have 4 mdirs
@@ -3354,7 +3354,7 @@ code = '''
LFSR_ATTR(1, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// we should now have 2 mdirs
@@ -3369,7 +3369,7 @@ code = '''
LFSR_ATTR(mdir.mid, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mdir to compact
mdir.u.r.rbyd.eoff = BLOCK_SIZE;
mdir.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &mdir, NULL, 0) => 0;
// we should now have 3 mdirs
@@ -3465,7 +3465,7 @@ code = '''
}
if (tag_ == LFSR_TAG_BTREE) {
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer;
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x btree 0x%x.%x\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -3475,7 +3475,7 @@ code = '''
// keep track of seen blocks
seen[branch->block / 8] |= 1 << (branch->block % 8);
} else if (tag_ == LFSR_TAG_MDIR) {
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer;
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -3545,7 +3545,7 @@ code = '''
LFSR_ATTR(0, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdir was unininlined correctly
@@ -3589,7 +3589,7 @@ code = '''
}
if (tag_ == LFSR_TAG_BTREE) {
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer;
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x btree 0x%x.%x\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -3599,7 +3599,7 @@ code = '''
// keep track of seen blocks
seen[branch->block / 8] |= 1 << (branch->block % 8);
} else if (tag_ == LFSR_TAG_MDIR) {
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer;
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -3679,7 +3679,7 @@ code = '''
LFSR_ATTR(1, REG, +1, BUF(buffer, SIZE)))) => 0;
// force mroot to compact
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
// assert mdirs were unininlined and split
@@ -3724,7 +3724,7 @@ code = '''
}
if (tag_ == LFSR_TAG_BTREE) {
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer;
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x btree 0x%x.%x\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -3734,7 +3734,7 @@ code = '''
// keep track of seen blocks
seen[branch->block / 8] |= 1 << (branch->block % 8);
} else if (tag_ == LFSR_TAG_MDIR) {
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer;
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -3814,9 +3814,9 @@ code = '''
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'b', SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0;
@@ -3851,7 +3851,7 @@ code = '''
}
if (tag_ == LFSR_TAG_BTREE) {
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer;
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x btree 0x%x.%x\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -3861,7 +3861,7 @@ code = '''
// keep track of seen blocks
seen[branch->block / 8] |= 1 << (branch->block % 8);
} else if (tag_ == LFSR_TAG_MDIR) {
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer;
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -3930,8 +3930,8 @@ code = '''
for (lfs_size_t i = 0; i < N; i++) {
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.eoff = -1;
lfs.mroot.u.r.rbyd.eoff = -1;
mdir.u.rbyd.eoff = -1;
lfs.mroot.u.rbyd.eoff = -1;
}
lfsr_mdir_commit(&lfs, &mdir, LFSR_ATTRS(
@@ -3989,7 +3989,7 @@ code = '''
}
if (tag_ == LFSR_TAG_BTREE) {
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer;
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x btree 0x%x.%x\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -3999,7 +3999,7 @@ code = '''
// keep track of seen blocks
seen[branch->block / 8] |= 1 << (branch->block % 8);
} else if (tag_ == LFSR_TAG_MDIR) {
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer;
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -4093,8 +4093,8 @@ code = '''
// force a compaction?
if (FORCE_COMPACTION) {
mdir.u.r.rbyd.eoff = -1;
lfs.mroot.u.r.rbyd.eoff = -1;
mdir.u.rbyd.eoff = -1;
lfs.mroot.u.rbyd.eoff = -1;
}
// add to rbyd, potentially splitting the mdir
@@ -4159,7 +4159,7 @@ code = '''
}
if (tag_ == LFSR_TAG_BTREE) {
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer;
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x btree 0x%x.%x\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -4169,7 +4169,7 @@ code = '''
// keep track of seen blocks
seen[branch->block / 8] |= 1 << (branch->block % 8);
} else if (tag_ == LFSR_TAG_MDIR) {
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer;
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -4267,14 +4267,14 @@ code = '''
}
if (tag_ == LFSR_TAG_BTREE) {
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.b.buffer;
lfsr_rbyd_t *branch = (lfsr_rbyd_t *)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x btree 0x%x.%x\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
tag_,
branch->block, branch->trunk);
} else if (tag_ == LFSR_TAG_MDIR) {
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.b.buffer;
lfsr_mdir_t *mdir = (lfsr_mdir_t*)data_.u.buffer.buffer;
printf("traversal: %d.%d 0x%x mdir 0x{%x,%x}\n",
mid_ >> lfs.mleaf_bits,
mid_ & lfsr_midrmask(&lfs),
@@ -4338,9 +4338,9 @@ code = '''
// force mroot to compact twice, this should extend the mroot
lfsr_mdir_t old_mroot = lfs.mroot;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'b', SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0;
@@ -4393,10 +4393,10 @@ code = '''
lfsr_mdir_t old_mroot = lfs.mroot;
for (int i = 0; i < 4; i++) {
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
lfsr_mdir_commit(&lfs, &lfs.mroot, NULL, 0) => 0;
}
lfs.mroot.u.r.rbyd.eoff = BLOCK_SIZE;
lfs.mroot.u.rbyd.eoff = BLOCK_SIZE;
memset(buffer, 'b', SIZE);
lfsr_mdir_commit(&lfs, &lfs.mroot, LFSR_ATTRS(
LFSR_ATTR(-1, UATTR(1), 0, BUF(buffer, SIZE)))) => 0;