gbmap: Tried to adopt the gbmap name more consistently

Having gbmap/bmap used in different places for the same thing was
confusing. Preferring gbmap as it is consistent with other gstate (grm
queue, gcksums), even if it is a bit noisy.

It's interesting to note what didn't change:

- The BM* range tags: LFS3_TAG_BMFREE, etc. These already differs from
  the GBMAP* prefix enough, and adopting GBM* would risk confusion for
  actual gstate.

- The gbmap revdbg string: "bb~r". We don't have enough characters for
  anything else!

- dbgbmap.py/dbgbmapsvg.py. These aren't actually related to the gbmap,
  so the name difference is a good thing.
This commit is contained in:
Christopher Haster
2025-10-06 14:05:31 -05:00
parent 9d322741ca
commit 9b4ee982bc
14 changed files with 488 additions and 487 deletions
+8 -8
View File
@@ -7,9 +7,9 @@
# since you can usually ignore allocator issues temporarily by making the test
# device really big
#
after = ['test_mtree', 'test_bmap', 'test_dirs', 'test_files']
after = ['test_mtree', 'test_gbmap', 'test_dirs', 'test_files']
defines.INIT_BLOCKS = 'LFS3_IFDEF_BMAP(3, 2)'
defines.INIT_BLOCKS = 'LFS3_IFDEF_GBMAP(3, 2)'
# test that we can alloc
[cases.test_alloc_alloc]
@@ -49,9 +49,9 @@ code = '''
}
// excluding our mroot, we should have allocated exactly
// block_count-2 blocks (this gets more complicated with a bmap)
// block_count-2 blocks (this gets more complicated with a gbmap)
printf("alloced %d/%d blocks\n", alloced, (lfs3_block_t)COUNT);
#ifndef LFS3_BMAP
#ifndef LFS3_GBMAP
assert(alloced == COUNT-2);
#endif
@@ -96,9 +96,9 @@ code = '''
}
// excluding our mroot, we should have allocated exactly
// block_count-2 blocks (this gets more complicated with a bmap)
// block_count-2 blocks (this gets more complicated with a gbmap)
printf("alloced %d/%d blocks\n", alloced, (lfs3_block_t)COUNT);
#ifndef LFS3_BMAP
#ifndef LFS3_GBMAP
assert(alloced == COUNT-2);
#endif
@@ -119,9 +119,9 @@ code = '''
}
// excluding our mroot, we should have allocated exactly
// block_count-2 blocks (this gets more complicated with a bmap)
// block_count-2 blocks (this gets more complicated with a gbmap)
printf("alloced %d/%d blocks\n", alloced, (lfs3_block_t)COUNT);
#ifndef LFS3_BMAP
#ifndef LFS3_GBMAP
assert(alloced == COUNT-2);
#endif
+1 -1
View File
@@ -11,7 +11,7 @@ after = [
'test_compat',
]
defines.INIT_BLOCKS = 'LFS3_IFDEF_BMAP(3, 2)'
defines.INIT_BLOCKS = 'LFS3_IFDEF_GBMAP(3, 2)'
## Single-block badblock tests
+1 -1
View File
@@ -2,7 +2,7 @@
after = 'test_rbyd'
# don't bother testing with more complicated block allocators
ifndef = 'LFS3_BMAP'
ifndef = 'LFS3_GBMAP'
# maximize lookahead buffer, we don't actually gc so we only get one pass
# of the disk for these tests
+4 -4
View File
@@ -1025,7 +1025,7 @@ code = '''
}
if (tinfo.btype == LFS3_BTYPE_BTREE
&& lfs3_t_tstate(trv.b.h.flags) != LFS3_TSTATE_BMAP) {
&& lfs3_t_tstate(trv.b.h.flags) != LFS3_TSTATE_GBMAP) {
if (k == i) {
// clobber this block
printf("clobbering 0x%x\n", tinfo.block);
@@ -1125,7 +1125,7 @@ code = '''
if ((tinfo.btype == LFS3_BTYPE_BTREE
|| tinfo.btype == LFS3_BTYPE_DATA)
&& lfs3_t_tstate(trv.b.h.flags) != LFS3_TSTATE_BMAP) {
&& lfs3_t_tstate(trv.b.h.flags) != LFS3_TSTATE_GBMAP) {
if (k == i) {
// clobber this block
printf("clobbering 0x%x\n", tinfo.block);
@@ -1231,7 +1231,7 @@ code = '''
}
if (tinfo.btype == LFS3_BTYPE_BTREE
&& lfs3_t_tstate(trv.b.h.flags) != LFS3_TSTATE_BMAP) {
&& lfs3_t_tstate(trv.b.h.flags) != LFS3_TSTATE_GBMAP) {
// found an interesting block?
if (k == i) {
badblock = tinfo.block;
@@ -1382,7 +1382,7 @@ code = '''
if ((tinfo.btype == LFS3_BTYPE_BTREE
|| tinfo.btype == LFS3_BTYPE_DATA)
&& lfs3_t_tstate(trv.b.h.flags) != LFS3_TSTATE_BMAP) {
&& lfs3_t_tstate(trv.b.h.flags) != LFS3_TSTATE_GBMAP) {
// found an interesting block?
if (k == i) {
badblock = tinfo.block;
+127 -127
View File
@@ -1,18 +1,18 @@
# Test some low-level block-map operations
#
# Note these is very much not-exhaustive, but the entire test suite can
# be run with the gbmap if you define LFS3_YES_BMAP:
# be run with the gbmap if you define LFS3_YES_GBMAP:
#
# LFS3_YES_BMAP=1 make test -j
# LFS3_YES_GBMAP=1 make test -j
#
after = ['test_btree', 'test_mtree']
ifdef = 'LFS3_BMAP'
ifdef = 'LFS3_GBMAP'
# test bmap operations
# test gbmap operations
# test simple set operations
[cases.test_bmap_set_split]
[cases.test_gbmap_set_split]
in = 'lfs3.c'
code = '''
lfs3_t lfs3;
@@ -20,52 +20,52 @@ code = '''
lfs3_mount(&lfs3, LFS3_M_RDWR, CFG) => 0;
lfs3_alloc_ckpoint(&lfs3);
// create an initial bmap
lfs3_btree_t bmap;
lfs3_btree_init(&bmap);
lfs3_bmap_commit(&lfs3, &bmap, 0, LFS3_RATTRS(
// create an initial gbmap
lfs3_btree_t gbmap;
lfs3_btree_init(&gbmap);
lfs3_gbmap_commit(&lfs3, &gbmap, 0, LFS3_RATTRS(
LFS3_RATTR(LFS3_TAG_BMFREE, +BLOCK_COUNT))) => 0;
// set some blocks as in-use, avoid any weird merges for now
lfs3_bmap_set(&lfs3, &bmap, 6, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 8, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 10, LFS3_TAG_BMINUSE) => 0;
printf("bmap: w%d 0x%x.%x\n",
bmap.r.weight,
bmap.r.blocks[0],
bmap.r.trunk);
lfs3_gbmap_set(&lfs3, &gbmap, 6, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 8, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 10, LFS3_TAG_BMINUSE) => 0;
printf("gbmap: w%d 0x%x.%x\n",
gbmap.r.weight,
gbmap.r.blocks[0],
gbmap.r.trunk);
// weight should stay the same
assert(bmap.r.weight == BLOCK_COUNT);
assert(gbmap.r.weight == BLOCK_COUNT);
// check ranges
lfs3_bid_t bid_;
lfs3_bid_t weight_;
lfs3_bmap_lookupnext(&lfs3, &bmap, 0,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 0,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 5);
assert(weight_ == 6);
lfs3_bmap_lookupnext(&lfs3, &bmap, 6,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 6,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == 6);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 7,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 7,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 7);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 8,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 8,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == 8);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 9,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 9,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 9);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 10,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 10,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == 10);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 11,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 11,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == BLOCK_COUNT-1);
assert(weight_ == BLOCK_COUNT-11);
@@ -73,7 +73,7 @@ code = '''
lfs3_unmount(&lfs3) => 0;
'''
[cases.test_bmap_set_replace]
[cases.test_gbmap_set_replace]
in = 'lfs3.c'
code = '''
lfs3_t lfs3;
@@ -81,56 +81,56 @@ code = '''
lfs3_mount(&lfs3, LFS3_M_RDWR, CFG) => 0;
lfs3_alloc_ckpoint(&lfs3);
// create an initial bmap
lfs3_btree_t bmap;
lfs3_btree_init(&bmap);
lfs3_bmap_commit(&lfs3, &bmap, 0, LFS3_RATTRS(
// create an initial gbmap
lfs3_btree_t gbmap;
lfs3_btree_init(&gbmap);
lfs3_gbmap_commit(&lfs3, &gbmap, 0, LFS3_RATTRS(
LFS3_RATTR(LFS3_TAG_BMFREE, +BLOCK_COUNT))) => 0;
// set some blocks as in-use, avoid any weird merges for now
lfs3_bmap_set(&lfs3, &bmap, 6, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 8, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 10, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 6, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 8, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 10, LFS3_TAG_BMINUSE) => 0;
// replace those blocks as bad, this tests deleting ranges
lfs3_bmap_set(&lfs3, &bmap, 6, LFS3_TAG_BMBAD) => 0;
lfs3_bmap_set(&lfs3, &bmap, 8, LFS3_TAG_BMBAD) => 0;
lfs3_bmap_set(&lfs3, &bmap, 10, LFS3_TAG_BMBAD) => 0;
printf("bmap: w%d 0x%x.%x\n",
bmap.r.weight,
bmap.r.blocks[0],
bmap.r.trunk);
lfs3_gbmap_set(&lfs3, &gbmap, 6, LFS3_TAG_BMBAD) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 8, LFS3_TAG_BMBAD) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 10, LFS3_TAG_BMBAD) => 0;
printf("gbmap: w%d 0x%x.%x\n",
gbmap.r.weight,
gbmap.r.blocks[0],
gbmap.r.trunk);
// weight should stay the same
assert(bmap.r.weight == BLOCK_COUNT);
assert(gbmap.r.weight == BLOCK_COUNT);
// check ranges
lfs3_bid_t bid_;
lfs3_bid_t weight_;
lfs3_bmap_lookupnext(&lfs3, &bmap, 0,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 0,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 5);
assert(weight_ == 6);
lfs3_bmap_lookupnext(&lfs3, &bmap, 6,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 6,
&bid_, &weight_) => LFS3_TAG_BMBAD;
assert(bid_ == 6);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 7,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 7,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 7);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 8,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 8,
&bid_, &weight_) => LFS3_TAG_BMBAD;
assert(bid_ == 8);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 9,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 9,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 9);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 10,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 10,
&bid_, &weight_) => LFS3_TAG_BMBAD;
assert(bid_ == 10);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 11,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 11,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == BLOCK_COUNT-1);
assert(weight_ == BLOCK_COUNT-11);
@@ -138,7 +138,7 @@ code = '''
lfs3_unmount(&lfs3) => 0;
'''
[cases.test_bmap_set_merge]
[cases.test_gbmap_set_merge]
in = 'lfs3.c'
code = '''
lfs3_t lfs3;
@@ -146,57 +146,57 @@ code = '''
lfs3_mount(&lfs3, LFS3_M_RDWR, CFG) => 0;
lfs3_alloc_ckpoint(&lfs3);
// create an initial bmap
lfs3_btree_t bmap;
lfs3_btree_init(&bmap);
lfs3_bmap_commit(&lfs3, &bmap, 0, LFS3_RATTRS(
// create an initial gbmap
lfs3_btree_t gbmap;
lfs3_btree_init(&gbmap);
lfs3_gbmap_commit(&lfs3, &gbmap, 0, LFS3_RATTRS(
LFS3_RATTR(LFS3_TAG_BMFREE, +BLOCK_COUNT))) => 0;
// set some blocks as in-use, avoid any weird merges for now
lfs3_bmap_set(&lfs3, &bmap, 6, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 8, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 10, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 12, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 6, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 8, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 10, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 12, LFS3_TAG_BMINUSE) => 0;
// set neighboring blocks as in-use, triggering merges
lfs3_bmap_set(&lfs3, &bmap, 5, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 9, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 13, LFS3_TAG_BMINUSE) => 0;
printf("bmap: w%d 0x%x.%x\n",
bmap.r.weight,
bmap.r.blocks[0],
bmap.r.trunk);
lfs3_gbmap_set(&lfs3, &gbmap, 5, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 9, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 13, LFS3_TAG_BMINUSE) => 0;
printf("gbmap: w%d 0x%x.%x\n",
gbmap.r.weight,
gbmap.r.blocks[0],
gbmap.r.trunk);
// weight should stay the same
assert(bmap.r.weight == BLOCK_COUNT);
assert(gbmap.r.weight == BLOCK_COUNT);
// check ranges
lfs3_bid_t bid_;
lfs3_bid_t weight_;
lfs3_bmap_lookupnext(&lfs3, &bmap, 0,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 0,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 4);
assert(weight_ == 5);
lfs3_bmap_lookupnext(&lfs3, &bmap, 5,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 5,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == 6);
assert(weight_ == 2);
lfs3_bmap_lookupnext(&lfs3, &bmap, 7,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 7,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 7);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 8,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 8,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == 10);
assert(weight_ == 3);
lfs3_bmap_lookupnext(&lfs3, &bmap, 11,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 11,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 11);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 12,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 12,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == 13);
assert(weight_ == 2);
lfs3_bmap_lookupnext(&lfs3, &bmap, 14,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 14,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == BLOCK_COUNT-1);
assert(weight_ == BLOCK_COUNT-14);
@@ -204,7 +204,7 @@ code = '''
lfs3_unmount(&lfs3) => 0;
'''
[cases.test_bmap_set_noop]
[cases.test_gbmap_set_noop]
in = 'lfs3.c'
code = '''
lfs3_t lfs3;
@@ -212,58 +212,58 @@ code = '''
lfs3_mount(&lfs3, LFS3_M_RDWR, CFG) => 0;
lfs3_alloc_ckpoint(&lfs3);
// create an initial bmap
lfs3_btree_t bmap;
lfs3_btree_init(&bmap);
lfs3_bmap_commit(&lfs3, &bmap, 0, LFS3_RATTRS(
// create an initial gbmap
lfs3_btree_t gbmap;
lfs3_btree_init(&gbmap);
lfs3_gbmap_commit(&lfs3, &gbmap, 0, LFS3_RATTRS(
LFS3_RATTR(LFS3_TAG_BMFREE, +BLOCK_COUNT))) => 0;
// set some blocks as in-use, avoid any weird merges for now
lfs3_bmap_set(&lfs3, &bmap, 6, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 8, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 10, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 6, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 8, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 10, LFS3_TAG_BMINUSE) => 0;
// test a bunch of noops
lfs3_bmap_set(&lfs3, &bmap, 6, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 7, LFS3_TAG_BMFREE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 8, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 9, LFS3_TAG_BMFREE) => 0;
lfs3_bmap_set(&lfs3, &bmap, 10, LFS3_TAG_BMINUSE) => 0;
printf("bmap: w%d 0x%x.%x\n",
bmap.r.weight,
bmap.r.blocks[0],
bmap.r.trunk);
lfs3_gbmap_set(&lfs3, &gbmap, 6, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 7, LFS3_TAG_BMFREE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 8, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 9, LFS3_TAG_BMFREE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, 10, LFS3_TAG_BMINUSE) => 0;
printf("gbmap: w%d 0x%x.%x\n",
gbmap.r.weight,
gbmap.r.blocks[0],
gbmap.r.trunk);
// weight should stay the same
assert(bmap.r.weight == BLOCK_COUNT);
assert(gbmap.r.weight == BLOCK_COUNT);
// check ranges
lfs3_bid_t bid_;
lfs3_bid_t weight_;
lfs3_bmap_lookupnext(&lfs3, &bmap, 0,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 0,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 5);
assert(weight_ == 6);
lfs3_bmap_lookupnext(&lfs3, &bmap, 6,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 6,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == 6);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 7,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 7,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 7);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 8,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 8,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == 8);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 9,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 9,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == 9);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 10,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 10,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == 10);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 11,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 11,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == BLOCK_COUNT-1);
assert(weight_ == BLOCK_COUNT-11);
@@ -271,7 +271,7 @@ code = '''
lfs3_unmount(&lfs3) => 0;
'''
[cases.test_bmap_set_bounds]
[cases.test_gbmap_set_bounds]
in = 'lfs3.c'
code = '''
lfs3_t lfs3;
@@ -279,37 +279,37 @@ code = '''
lfs3_mount(&lfs3, LFS3_M_RDWR, CFG) => 0;
lfs3_alloc_ckpoint(&lfs3);
// create an initial bmap
lfs3_btree_t bmap;
lfs3_btree_init(&bmap);
lfs3_bmap_commit(&lfs3, &bmap, 0, LFS3_RATTRS(
// create an initial gbmap
lfs3_btree_t gbmap;
lfs3_btree_init(&gbmap);
lfs3_gbmap_commit(&lfs3, &gbmap, 0, LFS3_RATTRS(
LFS3_RATTR(LFS3_TAG_BMFREE, +BLOCK_COUNT))) => 0;
// test that setting the first and last blocks don't break anything
//
// though in theory blocks 0x{0,1} are immutable...
lfs3_bmap_set(&lfs3, &bmap, 0, LFS3_TAG_BMINUSE) => 0;
lfs3_bmap_set(&lfs3, &bmap, BLOCK_COUNT-1, LFS3_TAG_BMINUSE) => 0;
printf("bmap: w%d 0x%x.%x\n",
bmap.r.weight,
bmap.r.blocks[0],
bmap.r.trunk);
lfs3_gbmap_set(&lfs3, &gbmap, 0, LFS3_TAG_BMINUSE) => 0;
lfs3_gbmap_set(&lfs3, &gbmap, BLOCK_COUNT-1, LFS3_TAG_BMINUSE) => 0;
printf("gbmap: w%d 0x%x.%x\n",
gbmap.r.weight,
gbmap.r.blocks[0],
gbmap.r.trunk);
// weight should stay the same
assert(bmap.r.weight == BLOCK_COUNT);
assert(gbmap.r.weight == BLOCK_COUNT);
// check ranges
lfs3_bid_t bid_;
lfs3_bid_t weight_;
lfs3_bmap_lookupnext(&lfs3, &bmap, 0,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 0,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == 0);
assert(weight_ == 1);
lfs3_bmap_lookupnext(&lfs3, &bmap, 1,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, 1,
&bid_, &weight_) => LFS3_TAG_BMFREE;
assert(bid_ == BLOCK_COUNT-2);
assert(weight_ == BLOCK_COUNT-2);
lfs3_bmap_lookupnext(&lfs3, &bmap, BLOCK_COUNT-1,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, BLOCK_COUNT-1,
&bid_, &weight_) => LFS3_TAG_BMINUSE;
assert(bid_ == BLOCK_COUNT-1);
assert(weight_ == 1);
@@ -317,7 +317,7 @@ code = '''
lfs3_unmount(&lfs3) => 0;
'''
[cases.test_bmap_set_fuzz]
[cases.test_gbmap_set_fuzz]
defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512]
defines.TYPES = [2, 3, 4]
defines.SEED = 'range(20)'
@@ -329,10 +329,10 @@ code = '''
lfs3_mount(&lfs3, LFS3_M_RDWR, CFG) => 0;
lfs3_alloc_ckpoint(&lfs3);
// create an initial bmap
lfs3_btree_t bmap;
lfs3_btree_init(&bmap);
lfs3_bmap_commit(&lfs3, &bmap, 0, LFS3_RATTRS(
// create an initial gbmap
lfs3_btree_t gbmap;
lfs3_btree_init(&gbmap);
lfs3_gbmap_commit(&lfs3, &gbmap, 0, LFS3_RATTRS(
LFS3_RATTR(LFS3_TAG_BMFREE, +BLOCK_COUNT))) => 0;
// create a simulation to compare against
@@ -345,35 +345,35 @@ code = '''
for (lfs3_size_t i = 0; i < N; i++) {
// choose a pseudo-random block
lfs3_block_t block = TEST_PRNG(&prng) % BLOCK_COUNT;
// and pseudo-random bmap type
// and pseudo-random gbmap type
lfs3_tag_t tag = LFS3_TAG_BMRANGE + (TEST_PRNG(&prng) % TYPES);
// set in bmap
lfs3_bmap_set(&lfs3, &bmap, block, tag) => 0;
// set in gbmap
lfs3_gbmap_set(&lfs3, &gbmap, block, tag) => 0;
// and set in sim
sim[block] = tag;
}
printf("bmap: w%d 0x%x.%x\n",
bmap.r.weight,
bmap.r.blocks[0],
bmap.r.trunk);
printf("gbmap: w%d 0x%x.%x\n",
gbmap.r.weight,
gbmap.r.blocks[0],
gbmap.r.trunk);
// check if bmap matches sim
// check if gbmap matches sim
lfs3_size_t i = 0;
while (i < BLOCK_COUNT) {
// we need to convert our sim's raw blocks to compressed ranges,
// in theory our bmap is optimal
// in theory our gbmap is optimal
lfs3_tag_t tag = sim[i];
lfs3_size_t d = 1;
while (i+d < BLOCK_COUNT && sim[i+d] == tag) {
d += 1;
}
// does our bmap contain the optimal range?
// does our gbmap contain the optimal range?
lfs3_bid_t bid_;
lfs3_bid_t weight_;
lfs3_bmap_lookupnext(&lfs3, &bmap, i,
lfs3_gbmap_lookupnext(&lfs3, &gbmap, i,
&bid_, &weight_) => tag;
assert(bid_ == i+(weight_-1));
assert(weight_ == d);
+6 -6
View File
@@ -1459,7 +1459,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// run gc
if (AFTER == 0) {
@@ -1575,7 +1575,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
'''
@@ -1650,7 +1650,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// run gc
if (AFTER == 0) {
@@ -1766,7 +1766,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// test that we can reset flags with lfs3_fs_unck
lfs3_fs_unck(&lfs3, GC_FLAGS) => 0;
@@ -1781,7 +1781,7 @@ code = '''
// _not_ imply uncking ckmeta
| ((!(CKDATA && !CKMETA)) ? LFS3_I_CKMETA : 0)
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// run gc
if (AFTER == 0) {
@@ -1897,7 +1897,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
'''
+1 -1
View File
@@ -9,7 +9,7 @@ after = [
]
# TODO!! lfs3_fs_grow needs to be able to adjust an on-disk bmaps
ifndef = 'LFS3_BMAP'
ifndef = 'LFS3_GBMAP'
# test we can mount a filesystem with fewer blocks
+11 -11
View File
@@ -87,7 +87,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
'''
@@ -113,7 +113,7 @@ if = [
'LFS3_IFDEF_CKFETCHES(true, !CKFETCHES)',
'LFS3_IFDEF_CKMETAPARITY(true, !CKMETAPARITY)',
'LFS3_IFDEF_CKDATACKSUMS(true, !CKDATACKSUMS)',
'LFS3_IFDEF_BMAP(true, !GBMAP)',
'LFS3_IFDEF_GBMAP(true, !GBMAP)',
]
code = '''
lfs3_t lfs3;
@@ -131,7 +131,7 @@ code = '''
: 0)
| ((CKMETA) ? LFS3_F_CKMETA : 0)
| ((CKDATA) ? LFS3_F_CKDATA : 0)
| ((GBMAP) ? LFS3_IFDEF_BMAP(LFS3_F_GBMAP, -1) : 0),
| ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_F_GBMAP, -1) : 0),
CFG) => 0;
lfs3_mount(&lfs3, LFS3_M_RDWR, CFG) => 0;
@@ -144,9 +144,9 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(
| LFS3_IFDEF_YES_GBMAP(
LFS3_I_GBMAP,
(GBMAP) ? LFS3_IFDEF_BMAP(LFS3_I_GBMAP, -1) : 0)));
(GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0)));
lfs3_unmount(&lfs3) => 0;
'''
@@ -171,7 +171,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
// with LFS3_M_LOOKAHEAD, mount performs a lookahead scan
@@ -188,7 +188,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
'''
@@ -244,7 +244,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
// with LFS3_M_COMPACT, mount compact any uncompacted blocks
@@ -262,7 +262,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// mdir should have been compacted
lfs3_file_open(&lfs3, &file, "jellyfish", LFS3_O_RDONLY) => 0;
@@ -348,7 +348,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
// with LFS3_M_MKCONSISTENT, mount cleans up orphans eagerly
@@ -367,7 +367,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
lfs3_file_open(&lfs3, &file, "cuttlefish", LFS3_O_RDONLY) => 0;
+121 -121
View File
@@ -35,7 +35,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
assert(tinfo.block == 0 || tinfo.block == 1);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -74,7 +74,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
assert(tinfo.block == 0 || tinfo.block == 1);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -88,7 +88,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
assert(tinfo.block == 0 || tinfo.block == 1);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -127,7 +127,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
assert(tinfo.block == 0 || tinfo.block == 1);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -1714,7 +1714,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing
lfs3_trv_t trv;
@@ -1732,7 +1732,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
assert(tinfo.block == 0 || tinfo.block == 1);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -1749,7 +1749,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
'''
@@ -1803,7 +1803,7 @@ code = '''
lfs3_file_close(&lfs3, &file) => 0;
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -1819,7 +1819,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
'''
@@ -1855,7 +1855,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
assert(tinfo.block == 0 || tinfo.block == 1);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -1877,7 +1877,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try another mutation just for good measure
lfs3_file_open(&lfs3, &file, "tarantula",
@@ -1898,7 +1898,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_trv_close(&lfs3, &trv) => 0;
@@ -1944,7 +1944,7 @@ code = '''
lfs3_mkdir(&lfs3, "spider") => 0;
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -1960,7 +1960,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
'''
@@ -2010,7 +2010,7 @@ code = '''
lfs3_remove(&lfs3, "spider") => 0;
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -2026,7 +2026,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
'''
@@ -2071,7 +2071,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
assert(tinfo.block == 0 || tinfo.block == 1);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -2092,7 +2092,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_unmount(&lfs3) => 0;
'''
@@ -2165,7 +2165,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -2249,7 +2249,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_rewind(&lfs3, &file) => 0;
@@ -2333,7 +2333,7 @@ code = '''
lfs3_file_close(&lfs3, &file) => 0;
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -2349,7 +2349,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -2442,7 +2442,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -2458,7 +2458,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -2544,7 +2544,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -2560,7 +2560,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -2636,7 +2636,7 @@ code = '''
lfs3_file_flush(&lfs3, &file1) => 0;
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -2652,7 +2652,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_file_close(&lfs3, &file1) => 0;
lfs3_file_close(&lfs3, &file2) => 0;
@@ -2747,7 +2747,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -2763,7 +2763,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_file_close(&lfs3, &file1) => 0;
lfs3_file_close(&lfs3, &file2) => 0;
@@ -2851,7 +2851,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -2867,7 +2867,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_file_close(&lfs3, &file1) => 0;
lfs3_file_close(&lfs3, &file2) => 0;
@@ -2946,7 +2946,7 @@ code = '''
lfs3_file_close(&lfs3, &file1) => 0;
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -2966,7 +2966,7 @@ code = '''
? LFS3_I_CKMETA
: 0)
| ((!(CKDATA && DESYNC)) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_file_close(&lfs3, &file2) => 0;
@@ -3064,7 +3064,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -3084,7 +3084,7 @@ code = '''
? LFS3_I_CKMETA
: 0)
| ((!(CKDATA && DESYNC)) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_file_close(&lfs3, &file2) => 0;
@@ -3175,7 +3175,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -3195,7 +3195,7 @@ code = '''
? LFS3_I_CKMETA
: 0)
| ((!(CKDATA && DESYNC)) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
lfs3_file_close(&lfs3, &file2) => 0;
@@ -3281,7 +3281,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -3301,7 +3301,7 @@ code = '''
? LFS3_I_CKMETA
: 0)
| ((!(CKDATA && DESYNC)) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => LFS3_ERR_NOENT;
@@ -3390,7 +3390,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -3406,7 +3406,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => LFS3_ERR_NOENT;
@@ -3495,7 +3495,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -3511,7 +3511,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -3608,7 +3608,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -3624,7 +3624,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -3732,7 +3732,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -3748,7 +3748,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -3856,7 +3856,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -3872,7 +3872,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -3967,7 +3967,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -3983,7 +3983,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -4072,7 +4072,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -4088,7 +4088,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -4192,7 +4192,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -4208,7 +4208,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -4311,7 +4311,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -4327,7 +4327,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -4483,7 +4483,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -4499,7 +4499,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -4672,7 +4672,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -4688,7 +4688,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -4855,7 +4855,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -4871,7 +4871,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -5035,7 +5035,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -5051,7 +5051,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -5222,7 +5222,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -5238,7 +5238,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -5408,7 +5408,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -5424,7 +5424,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -5605,7 +5605,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_DATA);
// we should be at end of traversal now
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -5621,7 +5621,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check the file contents
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
@@ -5689,7 +5689,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing and compacting
lfs3_trv_t trv;
@@ -5707,7 +5707,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
assert(tinfo.block == 0 || tinfo.block == 1);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -5724,7 +5724,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// running another traversal should clear the uncompacted flag
lfs3_trv_rewind(&lfs3, &trv) => 0;
@@ -5747,7 +5747,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the file
for (int remount = 0; remount < 2; remount++) {
@@ -5828,7 +5828,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing and compacting
lfs3_trv_t trv;
@@ -5851,7 +5851,7 @@ code = '''
assert(tinfo.btype == LFS3_BTYPE_MDIR);
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -5871,7 +5871,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// running another traversal should clear the uncompacted flag
lfs3_trv_rewind(&lfs3, &trv) => 0;
@@ -5896,7 +5896,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the file
for (int remount = 0; remount < 2; remount++) {
@@ -5959,7 +5959,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing and compacting
lfs3_trv_t trv;
@@ -5979,7 +5979,7 @@ code = '''
assert(tinfo.btype == LFS3_BTYPE_MDIR);
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -5996,7 +5996,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// running another traversal should clear the uncompacted flag
lfs3_trv_rewind(&lfs3, &trv) => 0;
@@ -6019,7 +6019,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the file
for (int remount = 0; remount < 2; remount++) {
@@ -6109,7 +6109,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing and compacting
lfs3_trv_t trv;
@@ -6140,7 +6140,7 @@ code = '''
assert(tinfo.btype == LFS3_BTYPE_MDIR);
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -6158,7 +6158,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// running another traversal should clear the uncompacted flag
lfs3_trv_rewind(&lfs3, &trv) => 0;
@@ -6182,7 +6182,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {
@@ -6326,7 +6326,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing and compacting
lfs3_trv_t trv;
@@ -6362,7 +6362,7 @@ code = '''
assert(tinfo.btype == LFS3_BTYPE_MDIR);
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -6382,7 +6382,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// running another traversal should clear the uncompacted flag
lfs3_trv_rewind(&lfs3, &trv) => 0;
@@ -6408,7 +6408,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {
@@ -6557,7 +6557,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing and compacting
lfs3_trv_t trv;
@@ -6598,7 +6598,7 @@ code = '''
assert(tinfo.btype == LFS3_BTYPE_MDIR);
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -6618,7 +6618,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// running another traversal should clear the uncompacted flag
lfs3_trv_rewind(&lfs3, &trv) => 0;
@@ -6644,7 +6644,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {
@@ -6759,7 +6759,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing with mkconsistent
lfs3_trv_t trv;
@@ -6791,7 +6791,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -6817,7 +6817,7 @@ code = '''
// note ckdata implies ckmeta
| (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0)
| ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {
@@ -6890,7 +6890,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing with mkconsistent
lfs3_trv_t trv;
@@ -6944,7 +6944,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -6969,7 +6969,7 @@ code = '''
// note ckdata implies ckmeta
| (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0)
| ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {
@@ -7068,7 +7068,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing with mkconsistent
lfs3_trv_t trv;
@@ -7114,7 +7114,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -7140,7 +7140,7 @@ code = '''
// note ckdata implies ckmeta
| (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0)
| ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {
@@ -7239,7 +7239,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing with mkconsistent
lfs3_trv_t trv;
@@ -7285,7 +7285,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -7311,7 +7311,7 @@ code = '''
// note ckdata implies ckmeta
| (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0)
| ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {
@@ -7411,7 +7411,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing with mkconsistent
lfs3_trv_t trv;
@@ -7465,7 +7465,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -7491,7 +7491,7 @@ code = '''
// note ckdata implies ckmeta
| (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0)
| ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {
@@ -7591,7 +7591,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing with mkconsistent
lfs3_trv_t trv;
@@ -7645,7 +7645,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -7671,7 +7671,7 @@ code = '''
// note ckdata implies ckmeta
| (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0)
| ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {
@@ -7789,7 +7789,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing with mkconsistent
lfs3_trv_t trv;
@@ -7822,7 +7822,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -7851,7 +7851,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// running another traversal should clear the uncompacted flag
lfs3_trv_rewind(&lfs3, &trv) => 0;
@@ -7875,7 +7875,7 @@ code = '''
// note ckdata implies ckmeta
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
| ((!CKDATA) ? LFS3_I_CKDATA : 0)
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {
@@ -7971,7 +7971,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// try traversing with mkconsistent
lfs3_trv_t trv;
@@ -8026,7 +8026,7 @@ code = '''
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_MDIR);
}
#ifdef LFS3_YES_BMAP
#ifdef LFS3_YES_GBMAP
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
assert(tinfo.btype == LFS3_BTYPE_BTREE);
assert(tinfo.block == 2);
@@ -8054,7 +8054,7 @@ code = '''
| LFS3_I_COMPACT
| LFS3_I_CKMETA
| LFS3_I_CKDATA
| LFS3_IFDEF_YES_BMAP(LFS3_I_GBMAP, 0)));
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
// check we can still read the files
for (int remount = 0; remount < 2; remount++) {