mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-12-01 12:20:02 +00:00
trv: Reordered gbmap traversal before mdir iteration
This is in preparation for some traversal simplification ideas, which
rely on all auxiliary/non-file btrees being visitable before file
btrees.
In theory the order of file vs auxiliary btrees doesn't really matter,
other than the number of different routes from mtree/mroot -> gbmap/file
btrees being a bit of a pain.
Note this is not true for the mtree, which must come first for
lfs3_mount to work.
---
Adds a bit of code when building with the gbmap:
code stack ctx
before: 36480 2304 660
after: 36476 (-0.0%) 2304 (+0.0%) 660 (+0.0%)
code stack ctx
gbmap before: 39464 2320 772
gbmap after: 39524 (+0.2%) 2320 (+0.0%) 772 (+0.0%)
code stack ctx
gc before: 36552 2304 804
gc after: 36548 (-0.0%) 2304 (+0.0%) 804 (+0.0%)
This commit is contained in:
158
lfs3.c
158
lfs3.c
@ -10045,13 +10045,13 @@ enum lfs3_tstate {
|
||||
LFS3_TSTATE_MROOTANCHOR = 0,
|
||||
LFS3_TSTATE_MROOTCHAIN = 1,
|
||||
LFS3_TSTATE_MTREE = 2,
|
||||
LFS3_TSTATE_MDIRS = 3,
|
||||
LFS3_TSTATE_MDIR = 4,
|
||||
LFS3_TSTATE_BTREE = 5,
|
||||
LFS3_TSTATE_HANDLES = 6,
|
||||
LFS3_TSTATE_HBTREE = 7,
|
||||
LFS3_TSTATE_GBMAP = 8,
|
||||
LFS3_TSTATE_GBMAP_P = 9,
|
||||
LFS3_TSTATE_GBMAP = 3,
|
||||
LFS3_TSTATE_GBMAP_P = 4,
|
||||
LFS3_TSTATE_MDIRS = 5,
|
||||
LFS3_TSTATE_MDIR = 6,
|
||||
LFS3_TSTATE_BTREE = 7,
|
||||
LFS3_TSTATE_HANDLES = 8,
|
||||
LFS3_TSTATE_HBTREE = 9,
|
||||
LFS3_TSTATE_DONE = 10,
|
||||
};
|
||||
|
||||
@ -10114,12 +10114,25 @@ static lfs3_stag_t lfs3_mtree_traverse_(lfs3_t *lfs3, lfs3_mtrv_t *mtrv,
|
||||
LFS3_TAG_MASK8 | LFS3_TAG_STRUCT,
|
||||
&data);
|
||||
if (tag < 0) {
|
||||
// if we have no mtree (inlined mdir), we need to
|
||||
// traverse any files in our mroot next
|
||||
if (tag == LFS3_ERR_NOENT) {
|
||||
mtrv->b.h.mdir.mid = 0;
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_MDIR);
|
||||
continue;
|
||||
// if we have no mtree (inlined mdir), we need to
|
||||
// traverse any auxiliary btrees next
|
||||
if (LFS3_IFDEF_GBMAP(
|
||||
lfs3_f_isgbmap(lfs3->flags)
|
||||
&& !lfs3_t_ismtreeonly(mtrv->b.h.flags),
|
||||
false)) {
|
||||
#ifdef LFS3_GBMAP
|
||||
mtrv->b.shrub = lfs3->gbmap.b;
|
||||
lfs3_btrv_init(&mtrv->btrv);
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_GBMAP);
|
||||
continue;
|
||||
#endif
|
||||
// or any files in our mroot
|
||||
} else {
|
||||
mtrv->b.h.mdir.mid = 0;
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_MDIRS);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
@ -10193,23 +10206,11 @@ static lfs3_stag_t lfs3_mtree_traverse_(lfs3_t *lfs3, lfs3_mtrv_t *mtrv,
|
||||
err = lfs3_mtree_lookup(lfs3, mtrv->b.h.mdir.mid,
|
||||
&mtrv->b.h.mdir);
|
||||
if (err) {
|
||||
// end of mtree?
|
||||
// end of mtree? guess we're done
|
||||
if (err == LFS3_ERR_NOENT) {
|
||||
if (LFS3_IFDEF_GBMAP(
|
||||
lfs3_f_isgbmap(lfs3->flags),
|
||||
false)) {
|
||||
#ifdef LFS3_GBMAP
|
||||
// transition to traversing the gbmap if there is one
|
||||
mtrv->b.shrub = lfs3->gbmap.b;
|
||||
lfs3_btrv_init(&mtrv->btrv);
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_GBMAP);
|
||||
continue;
|
||||
#endif
|
||||
} else {
|
||||
// guess we're done
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_DONE);
|
||||
continue;
|
||||
}
|
||||
// guess we're done
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_DONE);
|
||||
continue;
|
||||
}
|
||||
return err;
|
||||
}
|
||||
@ -10217,6 +10218,11 @@ static lfs3_stag_t lfs3_mtree_traverse_(lfs3_t *lfs3, lfs3_mtrv_t *mtrv,
|
||||
// transition to traversing the mdir
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_MDIR);
|
||||
|
||||
// wait, no mtree? don't repeat the mroot
|
||||
if (lfs3->mtree.r.weight == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
bptr_->d.u.buffer = (const uint8_t*)&mtrv->b.h.mdir;
|
||||
return LFS3_TAG_MDIR;
|
||||
|
||||
@ -10299,10 +10305,10 @@ static lfs3_stag_t lfs3_mtree_traverse_(lfs3_t *lfs3, lfs3_mtrv_t *mtrv,
|
||||
// traverse any bshrubs/btrees we see, this includes the mtree
|
||||
// and any file btrees/bshrubs
|
||||
case LFS3_TSTATE_MTREE:;
|
||||
case LFS3_TSTATE_BTREE:;
|
||||
case LFS3_TSTATE_HBTREE:;
|
||||
case LFS3_TSTATE_GBMAP:;
|
||||
case LFS3_TSTATE_GBMAP_P:;
|
||||
case LFS3_TSTATE_BTREE:;
|
||||
case LFS3_TSTATE_HBTREE:;
|
||||
// traverse through our bshrub/btree
|
||||
tag = lfs3_bshrub_traverse(lfs3, &mtrv->b, &mtrv->btrv,
|
||||
NULL, NULL, &data);
|
||||
@ -10310,9 +10316,52 @@ static lfs3_stag_t lfs3_mtree_traverse_(lfs3_t *lfs3, lfs3_mtrv_t *mtrv,
|
||||
if (tag == LFS3_ERR_NOENT) {
|
||||
// clear the bshrub state
|
||||
lfs3_bshrub_init(&mtrv->b);
|
||||
// end of mtree? start iterating over mdirs
|
||||
if (lfs3_t_tstate(mtrv->b.h.flags)
|
||||
== LFS3_TSTATE_MTREE) {
|
||||
// end of mtree? have a gbmap? not mtreeonly? start
|
||||
// iterating over the gbmap
|
||||
if (LFS3_IFDEF_GBMAP(
|
||||
lfs3_f_isgbmap(lfs3->flags)
|
||||
&& lfs3_t_tstate(mtrv->b.h.flags)
|
||||
== LFS3_TSTATE_MTREE
|
||||
&& !lfs3_t_ismtreeonly(mtrv->b.h.flags),
|
||||
false)) {
|
||||
#ifdef LFS3_GBMAP
|
||||
mtrv->b.shrub = lfs3->gbmap.b;
|
||||
lfs3_btrv_init(&mtrv->btrv);
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_GBMAP);
|
||||
continue;
|
||||
#endif
|
||||
// end of gbmap? check if we also have an outdated on-disk
|
||||
// gbmap that doesn't match the active gbmap
|
||||
//
|
||||
// we need to include this in case the gbmap is rebuilt
|
||||
// multiple times before an mdir commit
|
||||
} else if (LFS3_IFDEF_GBMAP(
|
||||
lfs3_f_isgbmap(lfs3->flags)
|
||||
&& lfs3_t_tstate(mtrv->b.h.flags)
|
||||
== LFS3_TSTATE_GBMAP
|
||||
&& lfs3_btree_cmp(
|
||||
&lfs3->gbmap.b_p,
|
||||
&lfs3->gbmap.b) != 0,
|
||||
false)) {
|
||||
#ifdef LFS3_GBMAP
|
||||
mtrv->b.shrub = lfs3->gbmap.b_p;
|
||||
lfs3_btrv_init(&mtrv->btrv);
|
||||
lfs3_t_settstate(&mtrv->b.h.flags,
|
||||
LFS3_TSTATE_GBMAP_P);
|
||||
continue;
|
||||
#endif
|
||||
// end of mtree and auxiliary btrees? start
|
||||
// iterating over mdirs
|
||||
} else if (lfs3_t_tstate(mtrv->b.h.flags)
|
||||
== LFS3_TSTATE_MTREE
|
||||
|| LFS3_IFDEF_GBMAP(
|
||||
lfs3_t_tstate(mtrv->b.h.flags)
|
||||
== LFS3_TSTATE_GBMAP,
|
||||
false)
|
||||
|| LFS3_IFDEF_GBMAP(
|
||||
lfs3_t_tstate(mtrv->b.h.flags)
|
||||
== LFS3_TSTATE_GBMAP_P,
|
||||
false)) {
|
||||
mtrv->b.h.mdir.mid = 0;
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_MDIRS);
|
||||
continue;
|
||||
@ -10328,44 +10377,6 @@ static lfs3_stag_t lfs3_mtree_traverse_(lfs3_t *lfs3, lfs3_mtrv_t *mtrv,
|
||||
mtrv->h = mtrv->h->next;
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_HANDLES);
|
||||
continue;
|
||||
// end of gbmap? check if we also have an outdated on-disk
|
||||
// gbmap
|
||||
//
|
||||
// we need to include this in case the gbmap is rebuilt
|
||||
// multiple times before an mdir commit
|
||||
} else if (LFS3_IFDEF_GBMAP(
|
||||
lfs3_f_isgbmap(lfs3->flags)
|
||||
&& lfs3_t_tstate(mtrv->b.h.flags)
|
||||
== LFS3_TSTATE_GBMAP,
|
||||
false)) {
|
||||
#ifdef LFS3_GBMAP
|
||||
// if on-disk gbmap does not match the active gbmap,
|
||||
// transition to traversing the on-disk gbmap
|
||||
if (lfs3_btree_cmp(
|
||||
&lfs3->gbmap.b_p,
|
||||
&lfs3->gbmap.b) != 0) {
|
||||
mtrv->b.shrub = lfs3->gbmap.b_p;
|
||||
lfs3_btrv_init(&mtrv->btrv);
|
||||
lfs3_t_settstate(&mtrv->b.h.flags,
|
||||
LFS3_TSTATE_GBMAP_P);
|
||||
continue;
|
||||
// otherwise guess we're done
|
||||
} else {
|
||||
lfs3_t_settstate(&mtrv->b.h.flags,
|
||||
LFS3_TSTATE_DONE);
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
// end of on-disk gbmap? guess we're done
|
||||
} else if (LFS3_IFDEF_GBMAP(
|
||||
lfs3_f_isgbmap(lfs3->flags)
|
||||
&& lfs3_t_tstate(mtrv->b.h.flags)
|
||||
== LFS3_TSTATE_GBMAP_P,
|
||||
false)) {
|
||||
#ifdef LFS3_GBMAP
|
||||
lfs3_t_settstate(&mtrv->b.h.flags, LFS3_TSTATE_DONE);
|
||||
continue;
|
||||
#endif
|
||||
} else {
|
||||
LFS3_UNREACHABLE();
|
||||
}
|
||||
@ -17156,13 +17167,10 @@ static void lfs3_trv_clobber(lfs3_t *lfs3, lfs3_trv_t *trv) {
|
||||
lfs3_bshrub_init(&trv->gc.t.b);
|
||||
trv->gc.t.h = NULL;
|
||||
// opened mdir? skip to next omdir
|
||||
} else if (lfs3_t_tstate(trv->gc.t.b.h.flags) < LFS3_TSTATE_GBMAP) {
|
||||
} else if (lfs3_t_tstate(trv->gc.t.b.h.flags) < LFS3_TSTATE_DONE) {
|
||||
lfs3_t_settstate(&trv->gc.t.b.h.flags, LFS3_TSTATE_HANDLES);
|
||||
lfs3_bshrub_init(&trv->gc.t.b);
|
||||
trv->gc.t.h = (trv->gc.t.h) ? trv->gc.t.h->next : NULL;
|
||||
// auxiliary btrees? just say we're done
|
||||
} else if (lfs3_t_tstate(trv->gc.t.b.h.flags) < LFS3_TSTATE_DONE) {
|
||||
lfs3_t_settstate(&trv->gc.t.b.h.flags, LFS3_TSTATE_DONE);
|
||||
// done traversals should never need clobbering
|
||||
} else {
|
||||
LFS3_UNREACHABLE();
|
||||
|
||||
@ -52,6 +52,7 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -97,6 +98,7 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -111,6 +113,7 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -158,6 +161,7 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -1816,6 +1820,7 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -1890,6 +1895,7 @@ code = '''
|
||||
lfs3_file_close(&lfs3, &file) => 0;
|
||||
}
|
||||
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -1945,6 +1951,7 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -2037,6 +2044,7 @@ code = '''
|
||||
lfs3_mkdir(&lfs3, "spider") => 0;
|
||||
}
|
||||
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -2106,6 +2114,7 @@ code = '''
|
||||
lfs3_remove(&lfs3, "spider") => 0;
|
||||
}
|
||||
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -2170,6 +2179,7 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -2451,12 +2461,13 @@ code = '''
|
||||
lfs3_file_write(&lfs3, &file, wbuf1, SIZE) => SIZE;
|
||||
lfs3_file_close(&lfs3, &file) => 0;
|
||||
|
||||
// we should be at end of traversal now
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// we should be at end of traversal now
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -2538,6 +2549,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse btree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -2564,11 +2581,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -2650,6 +2662,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse one data block
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -2670,11 +2688,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -2765,12 +2778,13 @@ code = '''
|
||||
lfs3_file_write(&lfs3, &file1, wbuf1, SIZE) => SIZE;
|
||||
lfs3_file_flush(&lfs3, &file1) => 0;
|
||||
|
||||
// we should be at end of traversal now
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// we should be at end of traversal now
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -2856,6 +2870,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse btree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -2880,11 +2900,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -2970,6 +2985,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse one data block
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -2988,11 +3009,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -3079,6 +3095,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
|
||||
// close the file
|
||||
if (DESYNC) {
|
||||
@ -3087,11 +3109,6 @@ code = '''
|
||||
lfs3_file_close(&lfs3, &file1) => 0;
|
||||
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -3186,6 +3203,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse btree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -3208,11 +3231,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -3307,6 +3325,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse one data block
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -3323,11 +3347,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -3420,6 +3439,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse one data block
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -3433,11 +3458,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -3528,6 +3548,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse one data block
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -3546,11 +3572,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -3642,6 +3663,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse one data block
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -3655,11 +3682,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -3772,11 +3794,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -3866,6 +3883,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse a data block
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -3900,11 +3923,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -3999,6 +4017,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse two data blocks
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -4028,11 +4052,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -4127,11 +4146,6 @@ code = '''
|
||||
lfs3_remove(&lfs3, "uloborus") => 0;
|
||||
}
|
||||
|
||||
// traverse mroot
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse two data blocks
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -4143,11 +4157,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -4230,6 +4239,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse a data block
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -4252,11 +4267,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -4360,11 +4370,6 @@ code = '''
|
||||
// still traverse inlined mroots, so if this breaks in the future
|
||||
// I wouldn't worry too much about it
|
||||
//
|
||||
// traverse mroot
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse two data blocks
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -4376,11 +4381,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -4476,6 +4476,12 @@ code = '''
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse a data block
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
@ -4499,11 +4505,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -4675,11 +4676,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -4813,6 +4809,12 @@ code = '''
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -4868,11 +4870,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -5006,6 +5003,12 @@ code = '''
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -5055,11 +5058,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -5239,11 +5237,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -5383,6 +5376,12 @@ code = '''
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -5430,11 +5429,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -5620,11 +5614,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -5773,6 +5762,12 @@ code = '''
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -5821,11 +5816,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_DATA);
|
||||
// we should be at end of traversal now
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -5927,6 +5917,7 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -6075,6 +6066,7 @@ code = '''
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -6208,6 +6200,7 @@ code = '''
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -6364,21 +6357,22 @@ code = '''
|
||||
// should have split, traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
|
||||
// mdirs should have been compacted
|
||||
@ -6587,26 +6581,27 @@ code = '''
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
|
||||
if (COMPACTSET) {
|
||||
@ -6824,6 +6819,12 @@ code = '''
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdir
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -6844,11 +6845,6 @@ code = '''
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
|
||||
// mdirs should have been compacted
|
||||
@ -7031,10 +7027,23 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
if (ORPHANS > 3) {
|
||||
if (ORPHANS <= 3) {
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
} else {
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdirs
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -7045,11 +7054,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
}
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -7193,6 +7197,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
} else {
|
||||
// traverse mdirs
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
@ -7204,11 +7214,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
}
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -7354,6 +7359,12 @@ code = '''
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
if (ORPHANS <= 3) {
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse btree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -7364,6 +7375,12 @@ code = '''
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdirs
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -7381,11 +7398,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
}
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -7530,6 +7542,12 @@ code = '''
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
if (ORPHANS <= 3) {
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse btree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -7540,6 +7558,12 @@ code = '''
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdirs
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -7557,11 +7581,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
}
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -7707,6 +7726,12 @@ code = '''
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
if (ORPHANS <= 3) {
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse bshrub
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -7721,6 +7746,12 @@ code = '''
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdirs
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -7742,11 +7773,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
}
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -7892,6 +7918,12 @@ code = '''
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
if (ORPHANS <= 3) {
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse bshrub
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
@ -7906,6 +7938,12 @@ code = '''
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdirs
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -7927,11 +7965,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
}
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
@ -8097,10 +8130,23 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
if (ORPHANS > 3) {
|
||||
if (ORPHANS <= 3) {
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
} else {
|
||||
// traverse mtree
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
// traverse mdirs
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
@ -8111,11 +8157,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
}
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
|
||||
// we should have cleaned up all grms/orphans
|
||||
@ -8313,6 +8354,12 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
assert(tinfo.block == 0 || tinfo.block == 1);
|
||||
// traverse gbmap
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
} else {
|
||||
// traverse mdirs
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
@ -8324,11 +8371,6 @@ code = '''
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_MDIR);
|
||||
}
|
||||
if (GBMAP) {
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => 0;
|
||||
assert(tinfo.btype == LFS3_BTYPE_BTREE);
|
||||
assert(tinfo.block == 2);
|
||||
}
|
||||
lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT;
|
||||
lfs3_trv_close(&lfs3, &trv) => 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user