mirror of
https://github.com/littlefs-project/littlefs.git
synced 2025-12-01 12:20:02 +00:00
Renamed REPOP* -> RE*
So: - cfg.gc_repoplookahead_thresh -> cfg.gc_relookahead_thresh - cfg.gc_repopgbmap_thresh -> cfg.gc_regbmap_thresh - cfg.gbmap_repop_thresh -> cfg.gbmap_re_thresh - LFS3_*_REPOPLOOKAHEAD -> LFS3_*_RELOOKAHEAD - LFS3_*_REPOPGBMAP -> LFS3_*_REGBMAP Mainly trying to reduce the mouthful that is REPOPLOOKAHEAD and REPOPGBMAP. As a plus this also avoids potential confusion of "repop" as a push/pop related operation.
This commit is contained in:
141
lfs3.c
141
lfs3.c
@ -7402,19 +7402,19 @@ static inline bool lfs3_t_ismkconsistent(uint32_t flags) {
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool lfs3_t_isrepoplookahead(uint32_t flags) {
|
||||
static inline bool lfs3_t_isrelookahead(uint32_t flags) {
|
||||
(void)flags;
|
||||
#ifndef LFS3_RDONLY
|
||||
return flags & LFS3_T_REPOPLOOKAHEAD;
|
||||
return flags & LFS3_T_RELOOKAHEAD;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline bool lfs3_t_isrepopgbmap(uint32_t flags) {
|
||||
static inline bool lfs3_t_isregbmap(uint32_t flags) {
|
||||
(void)flags;
|
||||
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
|
||||
return flags & LFS3_T_REPOPGBMAP;
|
||||
return flags & LFS3_T_REGBMAP;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
@ -10612,9 +10612,9 @@ static lfs3_stag_t lfs3_mtree_gc(lfs3_t *lfs3, lfs3_mgc_t *mgc,
|
||||
#ifndef LFS3_RDONLY
|
||||
// checkpoint the allocator to maximize any lookahead scans
|
||||
//
|
||||
// note we try to repop even if the repoplookahead flag isn't
|
||||
// note we try to repopupate even if the relookahead flag isn't
|
||||
// set because there's no real downside
|
||||
if (lfs3_t_isrepoplookahead(mgc->t.b.h.flags)
|
||||
if (lfs3_t_isrelookahead(mgc->t.b.h.flags)
|
||||
&& !lfs3_t_ismtreeonly(mgc->t.b.h.flags)
|
||||
&& !lfs3_t_isckpointed(mgc->t.b.h.flags)) {
|
||||
lfs3_alloc_ckpoint_(lfs3);
|
||||
@ -10626,17 +10626,17 @@ static lfs3_stag_t lfs3_mtree_gc(lfs3_t *lfs3, lfs3_mgc_t *mgc,
|
||||
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
|
||||
// create a new gbmap snapshot
|
||||
//
|
||||
// note we _don't_ try to repop if the repopgbmap flag isn't set
|
||||
// note we _don't_ try to repopulate if the regbmap flag isn't set
|
||||
// because repopulating the gbmap requires disk writes and is
|
||||
// potentially destructive
|
||||
//
|
||||
// note because we bail as soon as a ckpoint is triggered
|
||||
// (lfs3_t_isckpointed), we don't need to include this snapshot
|
||||
// in traversals, the ckpointed flag also means we don't need to
|
||||
// worry about this repop condition becoming true later
|
||||
if (lfs3_t_isrepopgbmap(mgc->t.b.h.flags)
|
||||
// worry about this repopulation condition becoming true later
|
||||
if (lfs3_t_isregbmap(mgc->t.b.h.flags)
|
||||
&& lfs3_f_isgbmap(lfs3->flags)
|
||||
&& lfs3_t_isrepopgbmap(lfs3->flags)
|
||||
&& lfs3_t_isregbmap(lfs3->flags)
|
||||
&& !lfs3_t_ismtreeonly(mgc->t.b.h.flags)
|
||||
&& !lfs3_t_isckpointed(mgc->t.b.h.flags)) {
|
||||
// at least checkpoint the lookahead buffer
|
||||
@ -10675,7 +10675,7 @@ dropped:;
|
||||
#ifndef LFS3_RDONLY
|
||||
// mark in-use blocks in lookahead?
|
||||
#ifndef LFS3_2BONLY
|
||||
if (lfs3_t_isrepoplookahead(mgc->t.b.h.flags)
|
||||
if (lfs3_t_isrelookahead(mgc->t.b.h.flags)
|
||||
&& !lfs3_t_ismtreeonly(mgc->t.b.h.flags)
|
||||
&& !lfs3_t_isckpointed(mgc->t.b.h.flags)) {
|
||||
lfs3_alloc_markinusebptr(lfs3, tag, bptr_);
|
||||
@ -10684,9 +10684,9 @@ dropped:;
|
||||
|
||||
// mark in-use blocks in gbmap?
|
||||
#ifdef LFS3_GBMAP
|
||||
if (lfs3_t_isrepopgbmap(mgc->t.b.h.flags)
|
||||
if (lfs3_t_isregbmap(mgc->t.b.h.flags)
|
||||
&& lfs3_f_isgbmap(lfs3->flags)
|
||||
&& lfs3_t_isrepopgbmap(lfs3->flags)
|
||||
&& lfs3_t_isregbmap(lfs3->flags)
|
||||
&& !lfs3_t_ismtreeonly(mgc->t.b.h.flags)
|
||||
&& !lfs3_t_isckpointed(mgc->t.b.h.flags)) {
|
||||
int err = lfs3_gbmap_markbptr(lfs3, &mgc->gbmap_, tag, bptr_,
|
||||
@ -10768,9 +10768,9 @@ eot:;
|
||||
//
|
||||
// gbmap takes priority because it actually writes to disk
|
||||
if (LFS3_IFDEF_GBMAP(
|
||||
lfs3_t_isrepopgbmap(mgc->t.b.h.flags)
|
||||
lfs3_t_isregbmap(mgc->t.b.h.flags)
|
||||
&& lfs3_f_isgbmap(lfs3->flags)
|
||||
&& lfs3_t_isrepopgbmap(lfs3->flags)
|
||||
&& lfs3_t_isregbmap(lfs3->flags)
|
||||
&& !lfs3_t_ismtreeonly(mgc->t.b.h.flags)
|
||||
&& !lfs3_t_isckpointed(mgc->t.b.h.flags),
|
||||
false)) {
|
||||
@ -10779,7 +10779,7 @@ eot:;
|
||||
#endif
|
||||
|
||||
// was lookahead scan successful?
|
||||
} else if (lfs3_t_isrepoplookahead(mgc->t.b.h.flags)
|
||||
} else if (lfs3_t_isrelookahead(mgc->t.b.h.flags)
|
||||
&& !lfs3_t_ismtreeonly(mgc->t.b.h.flags)
|
||||
&& !lfs3_t_isckpointed(mgc->t.b.h.flags)) {
|
||||
lfs3_alloc_adopt(lfs3, lfs3->lookahead.ckpoint);
|
||||
@ -10917,7 +10917,7 @@ failed:;
|
||||
// range, cross-range sets are not currently not supported
|
||||
//
|
||||
// really this just provides a shortcut for bulk clearing ranges in
|
||||
// lfs3_alloc_repopgbmap
|
||||
// lfs3_alloc_regbmap
|
||||
static int lfs3_gbmap_mark_(lfs3_t *lfs3, lfs3_btree_t *gbmap,
|
||||
lfs3_block_t block, lfs3_block_t weight, lfs3_tag_t tag) {
|
||||
// lookup gbmap range
|
||||
@ -11093,7 +11093,7 @@ static inline void lfs3_alloc_ckpoint_(lfs3_t *lfs3) {
|
||||
#endif
|
||||
|
||||
// needed in lfs3_alloc_ckpoint
|
||||
static int lfs3_alloc_repopgbmap(lfs3_t *lfs3);
|
||||
static int lfs3_alloc_regbmap(lfs3_t *lfs3);
|
||||
|
||||
// checkpoint the allocator
|
||||
//
|
||||
@ -11109,12 +11109,12 @@ static inline int lfs3_alloc_ckpoint(lfs3_t *lfs3) {
|
||||
lfs3_alloc_ckpoint_(lfs3);
|
||||
|
||||
#ifdef LFS3_GBMAP
|
||||
// do we need to repop the gbmap?
|
||||
// do we need to repopulate the gbmap?
|
||||
if (lfs3_f_isgbmap(lfs3->flags)
|
||||
&& lfs3->gbmap.known < lfs3_min(
|
||||
lfs3->cfg->gbmap_repop_thresh,
|
||||
lfs3->cfg->gbmap_re_thresh,
|
||||
lfs3->block_count)) {
|
||||
int err = lfs3_alloc_repopgbmap(lfs3);
|
||||
int err = lfs3_alloc_regbmap(lfs3);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
@ -11238,7 +11238,7 @@ static void lfs3_alloc_adopt(lfs3_t *lfs3, lfs3_block_t known) {
|
||||
known);
|
||||
|
||||
// signal that lookahead is full
|
||||
lfs3->flags &= ~LFS3_I_REPOPLOOKAHEAD;
|
||||
lfs3->flags &= ~LFS3_I_RELOOKAHEAD;
|
||||
|
||||
// eagerly find the next free block so lookahead scans can make
|
||||
// the most progress
|
||||
@ -11248,10 +11248,10 @@ static void lfs3_alloc_adopt(lfs3_t *lfs3, lfs3_block_t known) {
|
||||
|
||||
// can we repopulate the lookahead buffer?
|
||||
#if !defined(LFS3_RDONLY)
|
||||
static inline bool lfs3_alloc_isrepoplookahead(const lfs3_t *lfs3) {
|
||||
static inline bool lfs3_alloc_isrelookahead(const lfs3_t *lfs3) {
|
||||
return lfs3->lookahead.known
|
||||
<= lfs3_min(
|
||||
lfs3->cfg->gc_repoplookahead_thresh,
|
||||
lfs3->cfg->gc_relookahead_thresh,
|
||||
lfs3_min(
|
||||
8*lfs3->cfg->lookahead_size-1,
|
||||
lfs3->block_count-1));
|
||||
@ -11260,12 +11260,12 @@ static inline bool lfs3_alloc_isrepoplookahead(const lfs3_t *lfs3) {
|
||||
|
||||
// can we repopulate the gbmap?
|
||||
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
|
||||
static inline bool lfs3_alloc_isrepopgbmap(const lfs3_t *lfs3) {
|
||||
static inline bool lfs3_alloc_isregbmap(const lfs3_t *lfs3) {
|
||||
return lfs3->gbmap.known
|
||||
<= lfs3_min(
|
||||
lfs3_max(
|
||||
lfs3->cfg->gc_repopgbmap_thresh,
|
||||
lfs3->cfg->gbmap_repop_thresh),
|
||||
lfs3->cfg->gc_regbmap_thresh,
|
||||
lfs3->cfg->gbmap_re_thresh),
|
||||
lfs3->block_count-1);
|
||||
}
|
||||
#endif
|
||||
@ -11294,8 +11294,8 @@ static void lfs3_alloc_inc(lfs3_t *lfs3) {
|
||||
lfs3->lookahead.ckpoint -= 1;
|
||||
|
||||
// signal that lookahead is no longer full
|
||||
if (lfs3_alloc_isrepoplookahead(lfs3)) {
|
||||
lfs3->flags |= LFS3_I_REPOPLOOKAHEAD;
|
||||
if (lfs3_alloc_isrelookahead(lfs3)) {
|
||||
lfs3->flags |= LFS3_I_RELOOKAHEAD;
|
||||
}
|
||||
|
||||
// decrement gbmap known window
|
||||
@ -11305,8 +11305,8 @@ static void lfs3_alloc_inc(lfs3_t *lfs3) {
|
||||
lfs3->gbmap.known = lfs3_smax(lfs3->gbmap.known-1, 0);
|
||||
|
||||
// signal that the gbmap is no longer full
|
||||
if (lfs3_alloc_isrepopgbmap(lfs3)) {
|
||||
lfs3->flags |= LFS3_I_REPOPGBMAP;
|
||||
if (lfs3_alloc_isregbmap(lfs3)) {
|
||||
lfs3->flags |= LFS3_I_REGBMAP;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -11419,7 +11419,7 @@ static lfs3_sblock_t lfs3_alloc(lfs3_t *lfs3, uint32_t flags) {
|
||||
// in-use in the next lookahead window
|
||||
//
|
||||
lfs3_mtrv_t mtrv;
|
||||
lfs3_mtrv_init(&mtrv, LFS3_T_RDONLY | LFS3_T_REPOPLOOKAHEAD);
|
||||
lfs3_mtrv_init(&mtrv, LFS3_T_RDONLY | LFS3_T_RELOOKAHEAD);
|
||||
while (true) {
|
||||
lfs3_bptr_t bptr;
|
||||
lfs3_stag_t tag = lfs3_mtree_traverse(lfs3, &mtrv,
|
||||
@ -11486,12 +11486,12 @@ static void lfs3_alloc_adoptgbmap(lfs3_t *lfs3,
|
||||
lfs3->gbmap.b = *gbmap;
|
||||
|
||||
// signal that gbmap is full
|
||||
lfs3->flags &= ~LFS3_I_REPOPGBMAP;
|
||||
lfs3->flags &= ~LFS3_I_REGBMAP;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
|
||||
static int lfs3_alloc_repopgbmap(lfs3_t *lfs3) {
|
||||
static int lfs3_alloc_regbmap(lfs3_t *lfs3) {
|
||||
LFS3_INFO("Repopulating gbmap (gbmap %"PRId32"/%"PRId32")",
|
||||
lfs3->gbmap.known,
|
||||
lfs3->block_count);
|
||||
@ -11536,7 +11536,7 @@ static int lfs3_alloc_repopgbmap(lfs3_t *lfs3) {
|
||||
//
|
||||
// we don't commit this to disk immediately, instead we piggypack on
|
||||
// the next mdir commit, most writes terminate in an mdir commit so
|
||||
// this avoids extra writing at a risk of needing to repop the
|
||||
// this avoids extra writing at a risk of needing to repopulate the
|
||||
// gbmap if we lose power
|
||||
//
|
||||
lfs3_alloc_adoptgbmap(lfs3, &gbmap_, lfs3->lookahead.ckpoint);
|
||||
@ -15459,8 +15459,8 @@ static int lfs3_init(lfs3_t *lfs3, uint32_t flags,
|
||||
// unknown gc flags?
|
||||
LFS3_ASSERT((lfs3->cfg->gc_flags & ~(
|
||||
LFS3_GC_MKCONSISTENT
|
||||
| LFS3_GC_REPOPLOOKAHEAD
|
||||
| LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, 0)
|
||||
| LFS3_GC_RELOOKAHEAD
|
||||
| LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, 0)
|
||||
| LFS3_GC_COMPACTMETA
|
||||
| LFS3_GC_CKMETA
|
||||
| LFS3_GC_CKDATA)) == 0);
|
||||
@ -15488,7 +15488,7 @@ static int lfs3_init(lfs3_t *lfs3, uint32_t flags,
|
||||
// assume we contain orphans until proven otherwise
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_MKCONSISTENT)
|
||||
// default to an empty lookahead
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_REPOPLOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_RELOOKAHEAD)
|
||||
// default to assuming we need compaction somewhere, worst case
|
||||
// this just makes lfs3_fs_gc read more than is strictly needed
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACTMETA)
|
||||
@ -16298,12 +16298,12 @@ static int lfs3_mountinited(lfs3_t *lfs3) {
|
||||
lfs3->lookahead.window = lfs3->gbmap.window;
|
||||
|
||||
// mark our gbmap as repopulatable if known window is
|
||||
// <= gc_repopgbmap_thresh
|
||||
// <= gc_regbmap_thresh
|
||||
//
|
||||
// unfortunately the dependency of the gbmap on block allocation
|
||||
// means this rarely includes the entire disk
|
||||
if (lfs3_alloc_isrepopgbmap(lfs3)) {
|
||||
lfs3->flags |= LFS3_I_REPOPGBMAP;
|
||||
if (lfs3_alloc_isregbmap(lfs3)) {
|
||||
lfs3->flags |= LFS3_I_REGBMAP;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -16357,11 +16357,11 @@ int lfs3_mount(lfs3_t *lfs3, uint32_t flags,
|
||||
#ifdef LFS3_YES_MKCONSISTENT
|
||||
flags |= LFS3_M_MKCONSISTENT;
|
||||
#endif
|
||||
#ifdef LFS3_YES_REPOPLOOKAHEAD
|
||||
flags |= LFS3_M_REPOPLOOKAHEAD;
|
||||
#ifdef LFS3_YES_RELOOKAHEAD
|
||||
flags |= LFS3_M_RELOOKAHEAD;
|
||||
#endif
|
||||
#ifdef LFS3_YES_REPOPGBMAP
|
||||
flags |= LFS3_YES_REPOPGBMAP;
|
||||
#ifdef LFS3_YES_REGBMAP
|
||||
flags |= LFS3_YES_REGBMAP;
|
||||
#endif
|
||||
#ifdef LFS3_YES_COMPACTMETA
|
||||
flags |= LFS3_M_COMPACTMETA;
|
||||
@ -16386,16 +16386,16 @@ int lfs3_mount(lfs3_t *lfs3, uint32_t flags,
|
||||
| LFS3_IFDEF_CKMETAPARITY(LFS3_M_CKMETAPARITY, 0)
|
||||
| LFS3_IFDEF_CKDATACKSUMS(LFS3_M_CKDATACKSUMS, 0)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_M_MKCONSISTENT)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_M_REPOPLOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_M_RELOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0,
|
||||
LFS3_IFDEF_GBMAP(LFS3_M_REPOPGBMAP, 0))
|
||||
LFS3_IFDEF_GBMAP(LFS3_M_REGBMAP, 0))
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_M_COMPACTMETA)
|
||||
| LFS3_M_CKMETA
|
||||
| LFS3_M_CKDATA)) == 0);
|
||||
// these flags require a writable filesystem
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(flags) || !lfs3_t_ismkconsistent(flags));
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(flags) || !lfs3_t_isrepoplookahead(flags));
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(flags) || !lfs3_t_isrepopgbmap(flags));
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(flags) || !lfs3_t_isrelookahead(flags));
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(flags) || !lfs3_t_isregbmap(flags));
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(flags) || !lfs3_t_compactmeta(flags));
|
||||
|
||||
int err = lfs3_init(lfs3,
|
||||
@ -16423,9 +16423,9 @@ int lfs3_mount(lfs3_t *lfs3, uint32_t flags,
|
||||
// run gc if requested
|
||||
if (flags & (
|
||||
LFS3_IFDEF_RDONLY(0, LFS3_M_MKCONSISTENT)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_M_REPOPLOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_M_RELOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0,
|
||||
LFS3_IFDEF_GBMAP(LFS3_M_REPOPGBMAP, 0))
|
||||
LFS3_IFDEF_GBMAP(LFS3_M_REGBMAP, 0))
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_M_COMPACTMETA)
|
||||
| LFS3_M_CKMETA
|
||||
| LFS3_M_CKDATA)) {
|
||||
@ -16433,9 +16433,9 @@ int lfs3_mount(lfs3_t *lfs3, uint32_t flags,
|
||||
err = lfs3_fs_gc_(lfs3, &mgc,
|
||||
flags & (
|
||||
LFS3_IFDEF_RDONLY(0, LFS3_M_MKCONSISTENT)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_M_REPOPLOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_M_RELOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0,
|
||||
LFS3_IFDEF_GBMAP(LFS3_M_REPOPGBMAP, 0))
|
||||
LFS3_IFDEF_GBMAP(LFS3_M_REGBMAP, 0))
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_M_COMPACTMETA)
|
||||
| LFS3_M_CKMETA
|
||||
| LFS3_M_CKDATA),
|
||||
@ -16777,9 +16777,8 @@ int lfs3_fs_stat(lfs3_t *lfs3, struct lfs3_fsinfo *fsinfo) {
|
||||
| LFS3_IFDEF_CKMETAPARITY(LFS3_I_CKMETAPARITY, 0)
|
||||
| LFS3_IFDEF_CKDATACKSUMS(LFS3_I_CKDATACKSUMS, 0)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_MKCONSISTENT)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_REPOPLOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0,
|
||||
LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, 0))
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_RELOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, 0))
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACTMETA)
|
||||
| LFS3_I_CKMETA
|
||||
| LFS3_I_CKDATA
|
||||
@ -17046,9 +17045,9 @@ static int lfs3_fs_gc_(lfs3_t *lfs3, lfs3_mgc_t *mgc,
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(lfs3->flags)
|
||||
|| !lfs3_t_ismkconsistent(flags));
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(lfs3->flags)
|
||||
|| !lfs3_t_isrepoplookahead(flags));
|
||||
|| !lfs3_t_isrelookahead(flags));
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(lfs3->flags)
|
||||
|| !lfs3_t_isrepopgbmap(flags));
|
||||
|| !lfs3_t_isregbmap(flags));
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(lfs3->flags)
|
||||
|| !lfs3_t_compactmeta(flags));
|
||||
|
||||
@ -17076,9 +17075,9 @@ static int lfs3_fs_gc_(lfs3_t *lfs3, lfs3_mgc_t *mgc,
|
||||
// don't bother with lookahead/gbmap if we've ckpointed
|
||||
#ifndef LFS3_RDONLY
|
||||
if (lfs3_t_isckpointed(mgc->t.b.h.flags)) {
|
||||
mgc->t.b.h.flags &= ~LFS3_T_REPOPLOOKAHEAD;
|
||||
mgc->t.b.h.flags &= ~LFS3_T_RELOOKAHEAD;
|
||||
#ifdef LFS3_GBMAP
|
||||
mgc->t.b.h.flags &= ~LFS3_T_REPOPGBMAP;
|
||||
mgc->t.b.h.flags &= ~LFS3_T_REGBMAP;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
@ -17091,9 +17090,9 @@ static int lfs3_fs_gc_(lfs3_t *lfs3, lfs3_mgc_t *mgc,
|
||||
|
||||
// do we really need a full traversal?
|
||||
if (!(mgc->t.b.h.flags & (
|
||||
LFS3_IFDEF_RDONLY(0, LFS3_GC_REPOPLOOKAHEAD)
|
||||
LFS3_IFDEF_RDONLY(0, LFS3_GC_RELOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0,
|
||||
LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, 0))
|
||||
LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, 0))
|
||||
| LFS3_GC_CKMETA
|
||||
| LFS3_GC_CKDATA))) {
|
||||
mgc->t.b.h.flags |= LFS3_T_MTREEONLY;
|
||||
@ -17142,9 +17141,9 @@ int lfs3_fs_unck(lfs3_t *lfs3, uint32_t flags) {
|
||||
// unknown flags?
|
||||
LFS3_ASSERT((flags & ~(
|
||||
LFS3_IFDEF_RDONLY(0, LFS3_I_MKCONSISTENT)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_REPOPLOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_RELOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0,
|
||||
LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, 0))
|
||||
LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, 0))
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACTMETA)
|
||||
| LFS3_I_CKMETA
|
||||
| LFS3_I_CKDATA)) == 0);
|
||||
@ -17217,7 +17216,7 @@ int lfs3_fs_grow(lfs3_t *lfs3, lfs3_size_t block_count_) {
|
||||
}
|
||||
|
||||
// checkpoint the lookahead buffer, but _not_ the gbmap, we
|
||||
// can't repop the gbmap until we've resized it
|
||||
// can't repopulate the gbmap until we've resized it
|
||||
lfs3_alloc_ckpoint_(lfs3);
|
||||
|
||||
// we don't need a copy because this is atomic, and mdir commit
|
||||
@ -17374,9 +17373,9 @@ int lfs3_trv_open(lfs3_t *lfs3, lfs3_trv_t *trv, uint32_t flags) {
|
||||
| LFS3_T_RDONLY
|
||||
| LFS3_T_MTREEONLY
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_T_MKCONSISTENT)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_T_REPOPLOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_T_RELOOKAHEAD)
|
||||
| LFS3_IFDEF_RDONLY(0,
|
||||
LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, 0))
|
||||
LFS3_IFDEF_GBMAP(LFS3_T_REGBMAP, 0))
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_T_COMPACTMETA)
|
||||
| LFS3_T_CKMETA
|
||||
| LFS3_T_CKDATA)) == 0);
|
||||
@ -17384,12 +17383,12 @@ int lfs3_trv_open(lfs3_t *lfs3, lfs3_trv_t *trv, uint32_t flags) {
|
||||
LFS3_ASSERT(!lfs3_m_isrdonly(lfs3->flags) || lfs3_t_isrdonly(flags));
|
||||
// these flags require a writable traversal
|
||||
LFS3_ASSERT(!lfs3_t_isrdonly(flags) || !lfs3_t_ismkconsistent(flags));
|
||||
LFS3_ASSERT(!lfs3_t_isrdonly(flags) || !lfs3_t_isrepoplookahead(flags));
|
||||
LFS3_ASSERT(!lfs3_t_isrdonly(flags) || !lfs3_t_isrepopgbmap(flags));
|
||||
LFS3_ASSERT(!lfs3_t_isrdonly(flags) || !lfs3_t_isrelookahead(flags));
|
||||
LFS3_ASSERT(!lfs3_t_isrdonly(flags) || !lfs3_t_isregbmap(flags));
|
||||
LFS3_ASSERT(!lfs3_t_isrdonly(flags) || !lfs3_t_compactmeta(flags));
|
||||
// some flags don't make sense when only traversing the mtree
|
||||
LFS3_ASSERT(!lfs3_t_ismtreeonly(flags) || !lfs3_t_isrepoplookahead(flags));
|
||||
LFS3_ASSERT(!lfs3_t_ismtreeonly(flags) || !lfs3_t_isrepopgbmap(flags));
|
||||
LFS3_ASSERT(!lfs3_t_ismtreeonly(flags) || !lfs3_t_isrelookahead(flags));
|
||||
LFS3_ASSERT(!lfs3_t_ismtreeonly(flags) || !lfs3_t_isregbmap(flags));
|
||||
LFS3_ASSERT(!lfs3_t_ismtreeonly(flags) || !lfs3_t_isckdata(flags));
|
||||
|
||||
// setup traversal state
|
||||
|
||||
44
lfs3.h
44
lfs3.h
@ -233,12 +233,11 @@ enum lfs3_type {
|
||||
0x00000100 // Make the filesystem consistent
|
||||
#endif
|
||||
#ifndef LFS3_RDONLY
|
||||
#define LFS3_M_REPOPLOOKAHEAD \
|
||||
#define LFS3_M_RELOOKAHEAD \
|
||||
0x00000200 // Repopulate lookahead buffer
|
||||
#endif
|
||||
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
|
||||
#define LFS3_M_REPOPGBMAP \
|
||||
0x00000400 // Repopulate the gbmap
|
||||
#define LFS3_M_REGBMAP 0x00000400 // Repopulate the gbmap
|
||||
#endif
|
||||
#ifndef LFS3_RDONLY
|
||||
#define LFS3_M_COMPACTMETA \
|
||||
@ -279,12 +278,11 @@ enum lfs3_type {
|
||||
0x00000100 // Filesystem needs mkconsistent to write
|
||||
#endif
|
||||
#ifndef LFS3_RDONLY
|
||||
#define LFS3_I_REPOPLOOKAHEAD \
|
||||
#define LFS3_I_RELOOKAHEAD \
|
||||
0x00000200 // Lookahead buffer is not full
|
||||
#endif
|
||||
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
|
||||
#define LFS3_I_REPOPGBMAP \
|
||||
0x00000400 // The gbmap is not full
|
||||
#define LFS3_I_REGBMAP 0x00000400 // The gbmap is not full
|
||||
#endif
|
||||
#ifndef LFS3_RDONLY
|
||||
#define LFS3_I_COMPACTMETA \
|
||||
@ -325,12 +323,11 @@ enum lfs3_btype {
|
||||
0x00000100 // Make the filesystem consistent
|
||||
#endif
|
||||
#ifndef LFS3_RDONLY
|
||||
#define LFS3_T_REPOPLOOKAHEAD \
|
||||
#define LFS3_T_RELOOKAHEAD \
|
||||
0x00000200 // Repopulate lookahead buffer
|
||||
#endif
|
||||
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
|
||||
#define LFS3_T_REPOPGBMAP \
|
||||
0x00000400 // Repopulate the gbmap
|
||||
#define LFS3_T_REGBMAP 0x00000400 // Repopulate the gbmap
|
||||
#endif
|
||||
#ifndef LFS3_RDONLY
|
||||
#define LFS3_T_COMPACTMETA \
|
||||
@ -354,12 +351,11 @@ enum lfs3_btype {
|
||||
0x00000100 // Make the filesystem consistent
|
||||
#endif
|
||||
#ifndef LFS3_RDONLY
|
||||
#define LFS3_GC_REPOPLOOKAHEAD \
|
||||
#define LFS3_GC_RELOOKAHEAD \
|
||||
0x00000200 // Repopulate lookahead buffer
|
||||
#endif
|
||||
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
|
||||
#define LFS3_GC_REPOPGBMAP \
|
||||
0x00000400 // Repopulate the gbmap
|
||||
#define LFS3_GC_REGBMAP 0x00000400 // Repopulate the gbmap
|
||||
#endif
|
||||
#ifndef LFS3_RDONLY
|
||||
#define LFS3_GC_COMPACTMETA \
|
||||
@ -371,9 +367,9 @@ enum lfs3_btype {
|
||||
// an alias for all possible GC work
|
||||
#define LFS3_GC_ALL ( \
|
||||
LFS3_IFDEF_RDONLY(0, LFS3_GC_MKCONSISTENT) \
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_GC_REPOPLOOKAHEAD) \
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_GC_RELOOKAHEAD) \
|
||||
| LFS3_IFDEF_RDONLY(0, \
|
||||
LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, 0)) \
|
||||
LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, 0)) \
|
||||
| LFS3_IFDEF_RDONLY(0, LFS3_GC_COMPACTMETA) \
|
||||
| LFS3_GC_CKMETA \
|
||||
| LFS3_GC_CKDATA)
|
||||
@ -507,7 +503,7 @@ struct lfs3_cfg {
|
||||
// any value >= 8*lookahead_size repopulates the lookahead buffer
|
||||
// after any block allocation.
|
||||
#ifndef LFS3_RDONLY
|
||||
lfs3_block_t gc_repoplookahead_thresh;
|
||||
lfs3_block_t gc_relookahead_thresh;
|
||||
#endif
|
||||
|
||||
// Threshold for repopulating the gbmap during gc. This can be set
|
||||
@ -516,13 +512,13 @@ struct lfs3_cfg {
|
||||
//
|
||||
// Note this only affects explicit gc operations. During normal
|
||||
// operations gbmap repopulations are controlled by
|
||||
// gbmap_repop_thresh.
|
||||
// gbmap_re_thresh.
|
||||
//
|
||||
// Any value <= gbmap_repop_thresh repopulates the gbmap when below
|
||||
// gbmap_repop_thresh, while -1 or any value >= block_count
|
||||
// Any value <= gbmap_re_thresh repopulates the gbmap when below
|
||||
// gbmap_re_thresh, while -1 or any value >= block_count
|
||||
// repopulates the lookahead buffer after any block allocation.
|
||||
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
|
||||
lfs3_block_t gc_repopgbmap_thresh;
|
||||
lfs3_block_t gc_regbmap_thresh;
|
||||
#endif
|
||||
|
||||
// Threshold for metadata compaction during gc in bytes.
|
||||
@ -611,14 +607,14 @@ struct lfs3_cfg {
|
||||
//
|
||||
// When <= this many blocks have a known state, littlefs will
|
||||
// traverse the filesystem and attempt to repopulate the gbmap.
|
||||
// Smaller values decrease repop frequency and improves overall
|
||||
// allocator throughput, at the risk of needing to fallback to the
|
||||
// slower lookahead allocator when empty.
|
||||
// Smaller values decrease repopulation frequency and improves
|
||||
// overall allocator throughput, at the risk of needing to fallback
|
||||
// to the slower lookahead allocator when empty.
|
||||
//
|
||||
// 0 only repopulates the gbmap when empty, minimizing gbmap
|
||||
// repops at the risk of large latency spikes.
|
||||
#ifdef LFS3_GBMAP
|
||||
lfs3_block_t gbmap_repop_thresh;
|
||||
lfs3_block_t gbmap_re_thresh;
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -882,7 +878,7 @@ typedef struct lfs3_mgc {
|
||||
lfs3_mtrv_t t;
|
||||
|
||||
#ifdef LFS3_GBMAP
|
||||
// repopulate gbmap when traversing with repopgbmap
|
||||
// repopulate gbmap when traversing with regbmap
|
||||
lfs3_btree_t gbmap_;
|
||||
#endif
|
||||
} lfs3_mgc_t;
|
||||
|
||||
@ -116,14 +116,13 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
BENCH_DEFINE(LOOKAHEAD_SIZE, 16 ) \
|
||||
BENCH_DEFINE(GC_FLAGS, LFS3_GC_ALL ) \
|
||||
BENCH_DEFINE(GC_STEPS, 0 ) \
|
||||
BENCH_DEFINE(GC_REPOPLOOKAHEAD_THRESH, \
|
||||
-1 ) \
|
||||
BENCH_DEFINE(GC_REPOPGBMAP_THRESH, -1 ) \
|
||||
BENCH_DEFINE(GC_RELOOKAHEAD_THRESH, -1 ) \
|
||||
BENCH_DEFINE(GC_REGBMAP_THRESH, -1 ) \
|
||||
BENCH_DEFINE(GC_COMPACTMETA_THRESH, 0 ) \
|
||||
BENCH_DEFINE(SHRUB_SIZE, BLOCK_SIZE/4 ) \
|
||||
BENCH_DEFINE(FRAGMENT_SIZE, LFS3_MIN(BLOCK_SIZE/8, 512) ) \
|
||||
BENCH_DEFINE(CRYSTAL_THRESH, BLOCK_SIZE/8 ) \
|
||||
BENCH_DEFINE(GBMAP_REPOP_THRESH, BLOCK_COUNT/4 ) \
|
||||
BENCH_DEFINE(GBMAP_RE_THRESH, BLOCK_COUNT/4 ) \
|
||||
BENCH_DEFINE(ERASE_VALUE, 0xff ) \
|
||||
BENCH_DEFINE(ERASE_CYCLES, 0 ) \
|
||||
BENCH_DEFINE(BADBLOCK_BEHAVIOR, LFS3_EMUBD_BADBLOCK_PROGERROR ) \
|
||||
@ -150,7 +149,7 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
.lookahead_size = LOOKAHEAD_SIZE, \
|
||||
BENCH_GBMAP_CFG \
|
||||
BENCH_GC_CFG \
|
||||
.gc_repoplookahead_thresh = GC_REPOPLOOKAHEAD_THRESH, \
|
||||
.gc_relookahead_thresh = GC_RELOOKAHEAD_THRESH, \
|
||||
.gc_compactmeta_thresh = GC_COMPACTMETA_THRESH, \
|
||||
.shrub_size = SHRUB_SIZE, \
|
||||
.fragment_size = FRAGMENT_SIZE, \
|
||||
@ -158,8 +157,8 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
|
||||
#ifdef LFS3_GBMAP
|
||||
#define BENCH_GBMAP_CFG \
|
||||
.gc_repopgbmap_thresh = GC_REPOPGBMAP_THRESH, \
|
||||
.gbmap_repop_thresh = GBMAP_REPOP_THRESH,
|
||||
.gc_regbmap_thresh = GC_REGBMAP_THRESH, \
|
||||
.gbmap_re_thresh = GBMAP_RE_THRESH,
|
||||
#else
|
||||
#define BENCH_GBMAP_CFG
|
||||
#endif
|
||||
|
||||
@ -107,14 +107,13 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
TEST_DEFINE(LOOKAHEAD_SIZE, 16 ) \
|
||||
TEST_DEFINE(GC_FLAGS, LFS3_GC_ALL ) \
|
||||
TEST_DEFINE(GC_STEPS, 0 ) \
|
||||
TEST_DEFINE(GC_REPOPLOOKAHEAD_THRESH, \
|
||||
-1 ) \
|
||||
TEST_DEFINE(GC_REPOPGBMAP_THRESH, -1 ) \
|
||||
TEST_DEFINE(GC_RELOOKAHEAD_THRESH, -1 ) \
|
||||
TEST_DEFINE(GC_REGBMAP_THRESH, -1 ) \
|
||||
TEST_DEFINE(GC_COMPACTMETA_THRESH, 0 ) \
|
||||
TEST_DEFINE(SHRUB_SIZE, BLOCK_SIZE/4 ) \
|
||||
TEST_DEFINE(FRAGMENT_SIZE, LFS3_MIN(BLOCK_SIZE/8, 512) ) \
|
||||
TEST_DEFINE(CRYSTAL_THRESH, BLOCK_SIZE/8 ) \
|
||||
TEST_DEFINE(GBMAP_REPOP_THRESH, BLOCK_COUNT/4 ) \
|
||||
TEST_DEFINE(GBMAP_RE_THRESH, BLOCK_COUNT/4 ) \
|
||||
TEST_DEFINE(ERASE_VALUE, 0xff ) \
|
||||
TEST_DEFINE(ERASE_CYCLES, 0 ) \
|
||||
TEST_DEFINE(BADBLOCK_BEHAVIOR, LFS3_EMUBD_BADBLOCK_PROGERROR ) \
|
||||
@ -141,7 +140,7 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
.lookahead_size = LOOKAHEAD_SIZE, \
|
||||
TEST_GBMAP_CFG \
|
||||
TEST_GC_CFG \
|
||||
.gc_repoplookahead_thresh = GC_REPOPLOOKAHEAD_THRESH, \
|
||||
.gc_relookahead_thresh = GC_RELOOKAHEAD_THRESH, \
|
||||
.gc_compactmeta_thresh = GC_COMPACTMETA_THRESH, \
|
||||
.shrub_size = SHRUB_SIZE, \
|
||||
.fragment_size = FRAGMENT_SIZE, \
|
||||
@ -149,8 +148,8 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size);
|
||||
|
||||
#ifdef LFS3_GBMAP
|
||||
#define TEST_GBMAP_CFG \
|
||||
.gc_repopgbmap_thresh = GC_REPOPGBMAP_THRESH, \
|
||||
.gbmap_repop_thresh = GBMAP_REPOP_THRESH,
|
||||
.gc_regbmap_thresh = GC_REGBMAP_THRESH, \
|
||||
.gbmap_re_thresh = GBMAP_RE_THRESH,
|
||||
#else
|
||||
#define TEST_GBMAP_CFG
|
||||
#endif
|
||||
|
||||
@ -96,18 +96,16 @@ M_CKMETAPARITY = 0x00200000 # y- Check metadata tag parity bits
|
||||
M_CKDATACKSUMS = 0x00800000 # y- Check data checksums on reads
|
||||
|
||||
M_MKCONSISTENT = 0x00000100 # y- Make the filesystem consistent
|
||||
M_REPOPLOOKAHEAD \
|
||||
= 0x00000200 # y- Repopulate lookahead buffer
|
||||
M_REPOPGBMAP = 0x00000400 # y- Repopulate the gbmap
|
||||
M_RELOOKAHEAD = 0x00000200 # y- Repopulate lookahead buffer
|
||||
M_REGBMAP = 0x00000400 # y- Repopulate the gbmap
|
||||
M_COMPACTMETA = 0x00000800 # y- Compact metadata logs
|
||||
M_CKMETA = 0x00001000 # y- Check metadata checksums
|
||||
M_CKDATA = 0x00002000 # y- Check metadata + data checksums
|
||||
|
||||
# GC flags
|
||||
GC_MKCONSISTENT = 0x00000100 # -- Make the filesystem consistent
|
||||
GC_REPOPLOOKAHEAD \
|
||||
= 0x00000200 # -- Repopulate lookahead buffer
|
||||
GC_REPOPGBMAP = 0x00000400 # -- Repopulate the gbmap
|
||||
GC_RELOOKAHEAD = 0x00000200 # -- Repopulate lookahead buffer
|
||||
GC_REGBMAP = 0x00000400 # -- Repopulate the gbmap
|
||||
GC_COMPACTMETA = 0x00000800 # -- Compact metadata logs
|
||||
GC_CKMETA = 0x00001000 # -- Check metadata checksums
|
||||
GC_CKDATA = 0x00002000 # -- Check metadata + data checksums
|
||||
@ -124,9 +122,8 @@ I_CKMETAPARITY = 0x00200000 # -- Mounted with LFS3_M_CKMETAPARITY
|
||||
I_CKDATACKSUMS = 0x00800000 # -- Mounted with LFS3_M_CKDATACKSUMS
|
||||
|
||||
I_MKCONSISTENT = 0x00000100 # -- Filesystem needs mkconsistent to write
|
||||
I_REPOPLOOKAHEAD \
|
||||
= 0x00000200 # -- Lookahead buffer is not full
|
||||
I_REPOPGBMAP = 0x00000400 # -- The gbmap is not full
|
||||
I_RELOOKAHEAD = 0x00000200 # -- Lookahead buffer is not full
|
||||
I_REGBMAP = 0x00000400 # -- The gbmap is not full
|
||||
I_COMPACTMETA = 0x00000800 # -- Filesystem may have uncompacted metadata
|
||||
I_CKMETA = 0x00001000 # -- Metadata checksums not checked recently
|
||||
I_CKDATA = 0x00002000 # -- Data checksums not checked recently
|
||||
@ -143,9 +140,8 @@ T_RDWR = 0 # -^ Open traversal as read and write
|
||||
T_RDONLY = 1 # -^ Open traversal as read only
|
||||
T_MTREEONLY = 0x00000002 # -- Only traverse the mtree
|
||||
T_MKCONSISTENT = 0x00000100 # -- Make the filesystem consistent
|
||||
T_REPOPLOOKAHEAD \
|
||||
= 0x00000200 # -- Repopulate lookahead buffer
|
||||
T_REPOPGBMAP = 0x00000400 # -- Repopulate the gbmap
|
||||
T_RELOOKAHEAD = 0x00000200 # -- Repopulate lookahead buffer
|
||||
T_REGBMAP = 0x00000400 # -- Repopulate the gbmap
|
||||
T_COMPACTMETA = 0x00000800 # -- Compact metadata logs
|
||||
T_CKMETA = 0x00001000 # -- Check metadata checksums
|
||||
T_CKDATA = 0x00002000 # -- Check metadata + data checksums
|
||||
|
||||
@ -18,7 +18,7 @@ if = '''
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
LFS3_GC_REPOPLOOKAHEAD
|
||||
LFS3_GC_RELOOKAHEAD
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
'''
|
||||
@ -56,7 +56,7 @@ code = '''
|
||||
// expect dirty initial state or else our test doesn't work
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags & LFS3_I_REPOPLOOKAHEAD);
|
||||
assert(fsinfo.flags & LFS3_I_RELOOKAHEAD);
|
||||
assert(lfs3.handles != &lfs3.gc.gc.t.b.h);
|
||||
|
||||
// run GC until we make progress
|
||||
@ -67,7 +67,7 @@ code = '''
|
||||
lfs3_fs_gc(&lfs3) => 0;
|
||||
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & LFS3_I_REPOPLOOKAHEAD)) {
|
||||
if (!(fsinfo.flags & LFS3_I_RELOOKAHEAD)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -87,7 +87,7 @@ code = '''
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
LFS3_GC_REPOPLOOKAHEAD
|
||||
LFS3_GC_RELOOKAHEAD
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
'''
|
||||
@ -126,7 +126,7 @@ code = '''
|
||||
// expect dirty initial state or else our test doesn't work
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags & LFS3_I_REPOPLOOKAHEAD);
|
||||
assert(fsinfo.flags & LFS3_I_RELOOKAHEAD);
|
||||
assert(lfs3.handles != &lfs3.gc.gc.t.b.h);
|
||||
|
||||
// run GC one step
|
||||
@ -149,7 +149,7 @@ code = '''
|
||||
|
||||
// we should _not_ make progress
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags & LFS3_I_REPOPLOOKAHEAD);
|
||||
assert(fsinfo.flags & LFS3_I_RELOOKAHEAD);
|
||||
|
||||
// check the file contents
|
||||
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
|
||||
@ -165,7 +165,7 @@ code = '''
|
||||
# gc_repoplookahead_thresh
|
||||
[cases.test_gc_repoplookahead_relaxed]
|
||||
# relax our repop thresh
|
||||
defines.GC_REPOPLOOKAHEAD_THRESH = [
|
||||
defines.GC_RELOOKAHEAD_THRESH = [
|
||||
'-1',
|
||||
'8*LOOKAHEAD_SIZE - (8*LOOKAHEAD_SIZE/4)',
|
||||
'8*LOOKAHEAD_SIZE - (8*LOOKAHEAD_SIZE/2)',
|
||||
@ -173,7 +173,7 @@ defines.GC_REPOPLOOKAHEAD_THRESH = [
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
LFS3_GC_REPOPLOOKAHEAD
|
||||
LFS3_GC_RELOOKAHEAD
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
'''
|
||||
@ -210,7 +210,7 @@ code = '''
|
||||
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & LFS3_I_REPOPLOOKAHEAD)) {
|
||||
if (!(fsinfo.flags & LFS3_I_RELOOKAHEAD)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -237,9 +237,9 @@ code = '''
|
||||
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (fsinfo.flags & LFS3_I_REPOPLOOKAHEAD) {
|
||||
if (fsinfo.flags & LFS3_I_RELOOKAHEAD) {
|
||||
// check that we actually relaxed repopulations
|
||||
if ((lfs3_size_t)GC_REPOPLOOKAHEAD_THRESH
|
||||
if ((lfs3_size_t)GC_RELOOKAHEAD_THRESH
|
||||
< (lfs3_size_t)(8*LOOKAHEAD_SIZE-1)) {
|
||||
assert(i > 0);
|
||||
} else {
|
||||
@ -258,7 +258,7 @@ code = '''
|
||||
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & LFS3_I_REPOPLOOKAHEAD)) {
|
||||
if (!(fsinfo.flags & LFS3_I_RELOOKAHEAD)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -275,12 +275,12 @@ code = '''
|
||||
|
||||
# test that repopgbmap can make progress in isolation
|
||||
[cases.test_gc_repopgbmap_progress]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
LFS3_GC_REPOPGBMAP
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
LFS3_GC_REGBMAP
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
'''
|
||||
@ -317,7 +317,7 @@ code = '''
|
||||
// expect dirty initial state or else our test doesn't work
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags & LFS3_I_REPOPGBMAP);
|
||||
assert(fsinfo.flags & LFS3_I_REGBMAP);
|
||||
assert(lfs3.handles != &lfs3.gc.gc.t.b.h);
|
||||
|
||||
// run GC until we make progress
|
||||
@ -328,7 +328,7 @@ code = '''
|
||||
lfs3_fs_gc(&lfs3) => 0;
|
||||
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & LFS3_I_REPOPGBMAP)) {
|
||||
if (!(fsinfo.flags & LFS3_I_REGBMAP)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -345,12 +345,12 @@ code = '''
|
||||
|
||||
# test that repopgbmap dirtying still works with the GC API
|
||||
[cases.test_gc_repopgbmap_mutation]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
LFS3_GC_REPOPGBMAP
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
LFS3_GC_REGBMAP
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
'''
|
||||
@ -390,7 +390,7 @@ code = '''
|
||||
// expect dirty initial state or else our test doesn't work
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags & LFS3_I_REPOPGBMAP);
|
||||
assert(fsinfo.flags & LFS3_I_REGBMAP);
|
||||
assert(lfs3.handles != &lfs3.gc.gc.t.b.h);
|
||||
|
||||
// run GC one step
|
||||
@ -413,7 +413,7 @@ code = '''
|
||||
|
||||
// we should _not_ make progress
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags & LFS3_I_REPOPGBMAP);
|
||||
assert(fsinfo.flags & LFS3_I_REGBMAP);
|
||||
|
||||
// check the file contents
|
||||
lfs3_file_open(&lfs3, &file, "spider", LFS3_O_RDONLY) => 0;
|
||||
@ -428,17 +428,17 @@ code = '''
|
||||
# test that we can relax gbmap repopulation with gc_repopgbmap_thresh
|
||||
[cases.test_gc_repopgbmap_relaxed]
|
||||
# relax our repop thresh
|
||||
defines.GC_REPOPGBMAP_THRESH = [
|
||||
defines.GC_REGBMAP_THRESH = [
|
||||
'-1',
|
||||
'BLOCK_COUNT - (BLOCK_COUNT/4)',
|
||||
'BLOCK_COUNT - (BLOCK_COUNT/2)',
|
||||
]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
LFS3_GC_REPOPGBMAP
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
LFS3_GC_REGBMAP
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
'''
|
||||
@ -476,7 +476,7 @@ code = '''
|
||||
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & LFS3_I_REPOPGBMAP)) {
|
||||
if (!(fsinfo.flags & LFS3_I_REGBMAP)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -503,9 +503,9 @@ code = '''
|
||||
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (fsinfo.flags & LFS3_I_REPOPGBMAP) {
|
||||
if (fsinfo.flags & LFS3_I_REGBMAP) {
|
||||
// check that we actually relaxed repopulations
|
||||
if ((lfs3_size_t)GC_REPOPGBMAP_THRESH
|
||||
if ((lfs3_size_t)GC_REGBMAP_THRESH
|
||||
< BLOCK_COUNT-1) {
|
||||
assert(i > 0);
|
||||
} else {
|
||||
@ -524,7 +524,7 @@ code = '''
|
||||
|
||||
struct lfs3_fsinfo fsinfo;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & LFS3_I_REPOPGBMAP)) {
|
||||
if (!(fsinfo.flags & LFS3_I_REGBMAP)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -541,12 +541,12 @@ code = '''
|
||||
|
||||
# test that compactmeta can make progress in isolation
|
||||
[cases.test_gc_compactmeta_progress]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
LFS3_GC_COMPACTMETA
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
'''
|
||||
@ -632,12 +632,12 @@ code = '''
|
||||
|
||||
# test that compactmeta dirtying still works with the GC API
|
||||
[cases.test_gc_compactmeta_mutation]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
LFS3_GC_COMPACTMETA
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
'''
|
||||
@ -738,13 +738,13 @@ code = '''
|
||||
|
||||
# test that mkconsistent can make progress in isolation
|
||||
[cases.test_gc_mkconsistent_progress]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
LFS3_GC_MKCONSISTENT
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -956,13 +956,13 @@ code = '''
|
||||
|
||||
# test that mkconsistent dirtying still works with the GC API
|
||||
[cases.test_gc_mkconsistent_mutation]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
LFS3_GC_MKCONSISTENT
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -1822,15 +1822,15 @@ done:;
|
||||
# AFTER=3 => after remounting
|
||||
defines.AFTER = [0, 1, 2, 3]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -1849,7 +1849,7 @@ defines.SIZE = [
|
||||
if = [
|
||||
'(SIZE*N)/BLOCK_SIZE <= 32',
|
||||
'LFS3_IFDEF_GC(true, AFTER != 0)',
|
||||
'GBMAP || !REPOPGBMAP',
|
||||
'GBMAP || !REGBMAP',
|
||||
]
|
||||
code = '''
|
||||
lfs3_t lfs3;
|
||||
@ -1886,9 +1886,9 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_REPOPLOOKAHEAD
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| ((GBMAP)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
& fsinfo.flags)
|
||||
: 0)
|
||||
| LFS3_I_COMPACTMETA
|
||||
@ -1911,9 +1911,9 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & (
|
||||
((MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
| ((RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
: 0)
|
||||
| ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_I_CKMETA : 0)
|
||||
@ -1943,9 +1943,9 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & (
|
||||
((MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
| ((RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
: 0)
|
||||
| ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_I_CKMETA : 0)
|
||||
@ -1957,11 +1957,11 @@ code = '''
|
||||
lfs3_fs_mkconsistent(&lfs3) => 0;
|
||||
}
|
||||
|
||||
if (REPOPLOOKAHEAD && (fsinfo.flags & LFS3_I_REPOPLOOKAHEAD)) {
|
||||
if (RELOOKAHEAD && (fsinfo.flags & LFS3_I_RELOOKAHEAD)) {
|
||||
// we need an explicit traversal for this
|
||||
lfs3_trv_t trv;
|
||||
lfs3_trv_open(&lfs3, &trv,
|
||||
LFS3_T_RDWR | LFS3_T_REPOPLOOKAHEAD) => 0;
|
||||
LFS3_T_RDWR | LFS3_T_RELOOKAHEAD) => 0;
|
||||
while (true) {
|
||||
struct lfs3_tinfo tinfo;
|
||||
int err = lfs3_trv_read(&lfs3, &trv, &tinfo);
|
||||
@ -1974,11 +1974,11 @@ code = '''
|
||||
}
|
||||
|
||||
#ifdef LFS3_GBMAP
|
||||
if (REPOPGBMAP && (fsinfo.flags & LFS3_I_REPOPGBMAP)) {
|
||||
if (REGBMAP && (fsinfo.flags & LFS3_I_REGBMAP)) {
|
||||
// we need an explicit traversal for this
|
||||
lfs3_trv_t trv;
|
||||
lfs3_trv_open(&lfs3, &trv,
|
||||
LFS3_T_RDWR | LFS3_T_REPOPGBMAP) => 0;
|
||||
LFS3_T_RDWR | LFS3_T_REGBMAP) => 0;
|
||||
while (true) {
|
||||
struct lfs3_tinfo tinfo;
|
||||
int err = lfs3_trv_read(&lfs3, &trv, &tinfo);
|
||||
@ -2029,10 +2029,10 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
((!MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0)
|
||||
| ((!REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((!REPOPGBMAP)
|
||||
| ((!RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((!REGBMAP)
|
||||
? ((GBMAP)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
& fsinfo.flags)
|
||||
: 0)
|
||||
: 0)
|
||||
@ -2053,15 +2053,15 @@ code = '''
|
||||
# AFTER=3 => after remounting
|
||||
defines.AFTER = [0, 1, 2, 3]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -2080,7 +2080,7 @@ defines.SIZE = [
|
||||
if = [
|
||||
'(SIZE*N)/BLOCK_SIZE <= 32',
|
||||
'LFS3_IFDEF_GC(true, AFTER != 0)',
|
||||
'GBMAP || !REPOPGBMAP',
|
||||
'GBMAP || !REGBMAP',
|
||||
]
|
||||
code = '''
|
||||
lfs3_t lfs3;
|
||||
@ -2117,9 +2117,9 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_REPOPLOOKAHEAD
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| ((GBMAP)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
& fsinfo.flags)
|
||||
: 0)
|
||||
| LFS3_I_COMPACTMETA
|
||||
@ -2142,9 +2142,9 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & (
|
||||
((MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
| ((RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
: 0)
|
||||
| ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_I_CKMETA : 0)
|
||||
@ -2174,9 +2174,9 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & (
|
||||
((MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
| ((RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
: 0)
|
||||
| ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_I_CKMETA : 0)
|
||||
@ -2188,11 +2188,11 @@ code = '''
|
||||
lfs3_fs_mkconsistent(&lfs3) => 0;
|
||||
}
|
||||
|
||||
if (REPOPLOOKAHEAD && (fsinfo.flags & LFS3_I_REPOPLOOKAHEAD)) {
|
||||
if (RELOOKAHEAD && (fsinfo.flags & LFS3_I_RELOOKAHEAD)) {
|
||||
// we need an explicit traversal for this
|
||||
lfs3_trv_t trv;
|
||||
lfs3_trv_open(&lfs3, &trv,
|
||||
LFS3_T_RDWR | LFS3_T_REPOPLOOKAHEAD) => 0;
|
||||
LFS3_T_RDWR | LFS3_T_RELOOKAHEAD) => 0;
|
||||
while (true) {
|
||||
struct lfs3_tinfo tinfo;
|
||||
int err = lfs3_trv_read(&lfs3, &trv, &tinfo);
|
||||
@ -2205,11 +2205,11 @@ code = '''
|
||||
}
|
||||
|
||||
#ifdef LFS3_GBMAP
|
||||
if (REPOPGBMAP && (fsinfo.flags & LFS3_I_REPOPGBMAP)) {
|
||||
if (REGBMAP && (fsinfo.flags & LFS3_I_REGBMAP)) {
|
||||
// we need an explicit traversal for this
|
||||
lfs3_trv_t trv;
|
||||
lfs3_trv_open(&lfs3, &trv,
|
||||
LFS3_T_RDWR | LFS3_T_REPOPGBMAP) => 0;
|
||||
LFS3_T_RDWR | LFS3_T_REGBMAP) => 0;
|
||||
while (true) {
|
||||
struct lfs3_tinfo tinfo;
|
||||
int err = lfs3_trv_read(&lfs3, &trv, &tinfo);
|
||||
@ -2260,10 +2260,10 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
((!MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0)
|
||||
| ((!REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((!REPOPGBMAP)
|
||||
| ((!RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((!REGBMAP)
|
||||
? ((GBMAP)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
& fsinfo.flags)
|
||||
: 0)
|
||||
: 0)
|
||||
@ -2280,11 +2280,11 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_REPOPLOOKAHEAD
|
||||
| ((REPOPGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1U)
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| ((REGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1U)
|
||||
: (GBMAP)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
& fsinfo.flags)
|
||||
: 0)
|
||||
| LFS3_I_COMPACTMETA
|
||||
@ -2309,9 +2309,9 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & (
|
||||
((MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
| ((RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
: 0)
|
||||
| ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_I_CKMETA : 0)
|
||||
@ -2341,9 +2341,9 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
if (!(fsinfo.flags & (
|
||||
((MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
| ((RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
: 0)
|
||||
| ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_I_CKMETA : 0)
|
||||
@ -2355,11 +2355,11 @@ code = '''
|
||||
lfs3_fs_mkconsistent(&lfs3) => 0;
|
||||
}
|
||||
|
||||
if (REPOPLOOKAHEAD && (fsinfo.flags & LFS3_I_REPOPLOOKAHEAD)) {
|
||||
if (RELOOKAHEAD && (fsinfo.flags & LFS3_I_RELOOKAHEAD)) {
|
||||
// we need an explicit traversal for this
|
||||
lfs3_trv_t trv;
|
||||
lfs3_trv_open(&lfs3, &trv,
|
||||
LFS3_T_RDWR | LFS3_T_REPOPLOOKAHEAD) => 0;
|
||||
LFS3_T_RDWR | LFS3_T_RELOOKAHEAD) => 0;
|
||||
while (true) {
|
||||
struct lfs3_tinfo tinfo;
|
||||
int err = lfs3_trv_read(&lfs3, &trv, &tinfo);
|
||||
@ -2372,11 +2372,11 @@ code = '''
|
||||
}
|
||||
|
||||
#ifdef LFS3_GBMAP
|
||||
if (REPOPGBMAP && (fsinfo.flags & LFS3_I_REPOPGBMAP)) {
|
||||
if (REGBMAP && (fsinfo.flags & LFS3_I_REGBMAP)) {
|
||||
// we need an explicit traversal for this
|
||||
lfs3_trv_t trv;
|
||||
lfs3_trv_open(&lfs3, &trv,
|
||||
LFS3_T_RDWR | LFS3_T_REPOPGBMAP) => 0;
|
||||
LFS3_T_RDWR | LFS3_T_REGBMAP) => 0;
|
||||
while (true) {
|
||||
struct lfs3_tinfo tinfo;
|
||||
int err = lfs3_trv_read(&lfs3, &trv, &tinfo);
|
||||
@ -2427,10 +2427,10 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
((!MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0)
|
||||
| ((!REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((!REPOPGBMAP)
|
||||
| ((!RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((!REGBMAP)
|
||||
? ((GBMAP)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1)
|
||||
? (LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
& fsinfo.flags)
|
||||
: 0)
|
||||
: 0)
|
||||
@ -2448,15 +2448,15 @@ code = '''
|
||||
[cases.test_gc_mutation]
|
||||
defines.N = 100
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -2472,7 +2472,7 @@ defines.SIZE = [
|
||||
'2*BLOCK_SIZE',
|
||||
'8*BLOCK_SIZE',
|
||||
]
|
||||
if = 'GBMAP || !REPOPGBMAP'
|
||||
if = 'GBMAP || !REGBMAP'
|
||||
ifdef = 'LFS3_GC'
|
||||
code = '''
|
||||
lfs3_t lfs3;
|
||||
@ -2523,15 +2523,15 @@ code = '''
|
||||
[cases.test_gc_mutation_unck]
|
||||
defines.N = 100
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -2547,7 +2547,7 @@ defines.SIZE = [
|
||||
'2*BLOCK_SIZE',
|
||||
'8*BLOCK_SIZE',
|
||||
]
|
||||
if = 'GBMAP || !REPOPGBMAP'
|
||||
if = 'GBMAP || !REGBMAP'
|
||||
ifdef = 'LFS3_GC'
|
||||
code = '''
|
||||
lfs3_t lfs3;
|
||||
@ -2601,15 +2601,15 @@ code = '''
|
||||
# test that gc work doesn't break anything in low-space condiditions
|
||||
[cases.test_gc_nospc]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -2619,7 +2619,7 @@ defines.GC_STEPS = [1, 2, 10, 100, 1000]
|
||||
# set compactmeta thresh to minimum
|
||||
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
|
||||
defines.SIZE = 'BLOCK_SIZE'
|
||||
if = 'GBMAP || !REPOPGBMAP'
|
||||
if = 'GBMAP || !REGBMAP'
|
||||
ifdef = 'LFS3_GC'
|
||||
code = '''
|
||||
lfs3_t lfs3;
|
||||
@ -2709,16 +2709,16 @@ code = '''
|
||||
|
||||
[cases.test_gc_spam_dir_many]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.UNCK = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -2727,7 +2727,7 @@ defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000]
|
||||
# set compactmeta thresh to minimum
|
||||
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256]
|
||||
if = 'GBMAP || !REPOPGBMAP'
|
||||
if = 'GBMAP || !REGBMAP'
|
||||
ifdef = 'LFS3_GC'
|
||||
code = '''
|
||||
// test creating directories
|
||||
@ -2819,16 +2819,16 @@ code = '''
|
||||
|
||||
[cases.test_gc_spam_dir_fuzz]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.UNCK = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -2840,7 +2840,7 @@ defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256]
|
||||
defines.OPS = '2*N'
|
||||
defines.SEED = 42
|
||||
fuzz = 'SEED'
|
||||
if = 'GBMAP || !REPOPGBMAP'
|
||||
if = 'GBMAP || !REGBMAP'
|
||||
ifdef = 'LFS3_GC'
|
||||
code = '''
|
||||
// test fuzz with dirs
|
||||
@ -3000,16 +3000,16 @@ code = '''
|
||||
|
||||
[cases.test_gc_spam_file_many]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.UNCK = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -3029,7 +3029,7 @@ defines.SIZE = [
|
||||
]
|
||||
if = [
|
||||
'(SIZE*N)/BLOCK_SIZE <= 32',
|
||||
'GBMAP || !REPOPGBMAP',
|
||||
'GBMAP || !REGBMAP',
|
||||
]
|
||||
ifdef = 'LFS3_GC'
|
||||
code = '''
|
||||
@ -3106,16 +3106,16 @@ code = '''
|
||||
|
||||
[cases.test_gc_spam_file_fuzz]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.UNCK = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -3138,7 +3138,7 @@ defines.SEED = 42
|
||||
fuzz = 'SEED'
|
||||
if = [
|
||||
'(SIZE*N)/BLOCK_SIZE <= 16',
|
||||
'GBMAP || !REPOPGBMAP',
|
||||
'GBMAP || !REGBMAP',
|
||||
]
|
||||
ifdef = 'LFS3_GC'
|
||||
code = '''
|
||||
@ -3351,16 +3351,16 @@ code = '''
|
||||
|
||||
[cases.test_gc_spam_fwrite_fuzz]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.UNCK = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -3390,7 +3390,7 @@ if = [
|
||||
'CHUNK <= SIZE',
|
||||
# this just saves testing time
|
||||
'SIZE <= 4*1024*FRAGMENT_SIZE',
|
||||
'GBMAP || !REPOPGBMAP',
|
||||
'GBMAP || !REGBMAP',
|
||||
]
|
||||
ifdef = 'LFS3_GC'
|
||||
code = '''
|
||||
@ -3514,16 +3514,16 @@ code = '''
|
||||
|
||||
[cases.test_gc_spam_uz_fuzz]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.UNCK = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -3548,7 +3548,7 @@ defines.SEED = 42
|
||||
fuzz = 'SEED'
|
||||
if = [
|
||||
'(SIZE*N)/BLOCK_SIZE <= 16',
|
||||
'GBMAP || !REPOPGBMAP',
|
||||
'GBMAP || !REGBMAP',
|
||||
]
|
||||
ifdef = 'LFS3_GC'
|
||||
code = '''
|
||||
@ -3970,16 +3970,16 @@ code = '''
|
||||
|
||||
[cases.test_gc_spam_uzd_fuzz]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.UNCK = [false, true]
|
||||
defines.GC_FLAGS = '''
|
||||
((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_GC_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, -1) : 0)
|
||||
| ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_GC_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_GC_CKDATA : 0)
|
||||
@ -4004,7 +4004,7 @@ defines.SEED = 42
|
||||
fuzz = 'SEED'
|
||||
if = [
|
||||
'(SIZE*N)/BLOCK_SIZE <= 16',
|
||||
'GBMAP || !REPOPGBMAP',
|
||||
'GBMAP || !REGBMAP',
|
||||
]
|
||||
ifdef = 'LFS3_GC'
|
||||
code = '''
|
||||
|
||||
@ -24,8 +24,8 @@ defines.CKFETCHES = [false, true]
|
||||
defines.CKMETAPARITY = [false, true]
|
||||
defines.CKDATACKSUMS = [false, true]
|
||||
defines.MKCONSISTENT = [false, true]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.REPOPGBMAP = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.REGBMAP = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
@ -38,9 +38,9 @@ if = [
|
||||
'LFS3_IFDEF_CKMETAPARITY(true, !CKMETAPARITY)',
|
||||
'LFS3_IFDEF_CKDATACKSUMS(true, !CKDATACKSUMS)',
|
||||
'!RDONLY || !MKCONSISTENT',
|
||||
'!RDONLY || !REPOPLOOKAHEAD',
|
||||
'LFS3_IFDEF_YES_GBMAP(true, !REPOPGBMAP)',
|
||||
'!RDONLY || !REPOPGBMAP',
|
||||
'!RDONLY || !RELOOKAHEAD',
|
||||
'LFS3_IFDEF_YES_GBMAP(true, !REGBMAP)',
|
||||
'!RDONLY || !REGBMAP',
|
||||
'!RDONLY || !COMPACTMETA',
|
||||
]
|
||||
code = '''
|
||||
@ -61,9 +61,9 @@ code = '''
|
||||
? LFS3_IFDEF_CKDATACKSUMS(LFS3_M_CKDATACKSUMS, -1)
|
||||
: 0)
|
||||
| ((MKCONSISTENT) ? LFS3_M_MKCONSISTENT : 0)
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_M_REPOPLOOKAHEAD : 0)
|
||||
| ((REPOPGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_M_REPOPGBMAP, -1)
|
||||
| ((RELOOKAHEAD) ? LFS3_M_RELOOKAHEAD : 0)
|
||||
| ((REGBMAP)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_M_REGBMAP, -1)
|
||||
: 0)
|
||||
| ((COMPACTMETA) ? LFS3_M_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_M_CKMETA : 0)
|
||||
@ -88,7 +88,7 @@ code = '''
|
||||
? LFS3_IFDEF_CKDATACKSUMS(LFS3_I_CKDATACKSUMS, -1)
|
||||
: 0)
|
||||
| ((!MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0)
|
||||
| ((!REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((!RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((!COMPACTMETA) ? LFS3_I_COMPACTMETA : 0)
|
||||
// note ckdata implies ckmeta
|
||||
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
|
||||
@ -146,7 +146,7 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_REPOPLOOKAHEAD
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_I_COMPACTMETA
|
||||
| LFS3_I_CKMETA
|
||||
| LFS3_I_CKDATA
|
||||
@ -173,17 +173,17 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_REPOPLOOKAHEAD
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_I_COMPACTMETA
|
||||
| LFS3_I_CKMETA
|
||||
| LFS3_I_CKDATA
|
||||
| LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0)));
|
||||
lfs3_unmount(&lfs3) => 0;
|
||||
|
||||
// with LFS3_M_REPOPLOOKAHEAD, mount performs a lookahead scan
|
||||
// with LFS3_M_RELOOKAHEAD, mount performs a lookahead scan
|
||||
lfs3_mount(&lfs3,
|
||||
LFS3_M_RDWR
|
||||
| LFS3_M_REPOPLOOKAHEAD
|
||||
| LFS3_M_RELOOKAHEAD
|
||||
| ((CKMETA) ? LFS3_M_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_M_CKDATA : 0),
|
||||
CFG) => 0;
|
||||
@ -220,7 +220,7 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_REPOPLOOKAHEAD
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_I_COMPACTMETA
|
||||
| LFS3_I_CKMETA
|
||||
| LFS3_I_CKDATA
|
||||
@ -242,19 +242,19 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_REPOPLOOKAHEAD
|
||||
| LFS3_I_REPOPGBMAP
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_I_REGBMAP
|
||||
| LFS3_I_COMPACTMETA
|
||||
| LFS3_I_CKMETA
|
||||
| LFS3_I_CKDATA
|
||||
| LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, 0)));
|
||||
lfs3_unmount(&lfs3) => 0;
|
||||
|
||||
// with LFS3_M_REPOPGBMAP, mount performs a gbmap repop
|
||||
// with LFS3_M_REGBMAP, mount performs a gbmap repop
|
||||
lfs3_mount(&lfs3,
|
||||
LFS3_M_RDWR
|
||||
| LFS3_M_REPOPLOOKAHEAD
|
||||
| LFS3_M_REPOPGBMAP
|
||||
| LFS3_M_RELOOKAHEAD
|
||||
| LFS3_M_REGBMAP
|
||||
| ((CKMETA) ? LFS3_M_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_M_CKDATA : 0),
|
||||
CFG) => 0;
|
||||
@ -270,7 +270,7 @@ code = '''
|
||||
'''
|
||||
|
||||
[cases.test_mount_t_compactmeta]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = [
|
||||
@ -317,9 +317,9 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_REPOPLOOKAHEAD
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_IFDEF_YES_GBMAP(
|
||||
(SIZE >= BLOCK_SIZE/4) ? LFS3_I_REPOPGBMAP : 0,
|
||||
(SIZE >= BLOCK_SIZE/4) ? LFS3_I_REGBMAP : 0,
|
||||
0)
|
||||
| LFS3_I_COMPACTMETA
|
||||
| LFS3_I_CKMETA
|
||||
@ -331,16 +331,16 @@ code = '''
|
||||
lfs3_mount(&lfs3,
|
||||
LFS3_M_RDWR
|
||||
| LFS3_M_COMPACTMETA
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_M_REPOPLOOKAHEAD : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_M_RELOOKAHEAD : 0)
|
||||
| ((CKMETA) ? LFS3_M_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_M_CKDATA : 0),
|
||||
CFG) => 0;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
| ((!REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
| ((!RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| LFS3_IFDEF_YES_GBMAP(
|
||||
(SIZE >= BLOCK_SIZE/4) ? LFS3_I_REPOPGBMAP : 0,
|
||||
(SIZE >= BLOCK_SIZE/4) ? LFS3_I_REGBMAP : 0,
|
||||
0)
|
||||
// note ckdata implies ckmeta
|
||||
| ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0)
|
||||
@ -361,7 +361,7 @@ code = '''
|
||||
'''
|
||||
|
||||
[cases.test_mount_t_mkconsistent]
|
||||
defines.REPOPLOOKAHEAD = [false, true]
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.COMPACTMETA = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
@ -427,9 +427,9 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
LFS3_I_MKCONSISTENT
|
||||
| LFS3_I_REPOPLOOKAHEAD
|
||||
| LFS3_I_RELOOKAHEAD
|
||||
| LFS3_IFDEF_YES_GBMAP(
|
||||
(ORPHANS >= 100) ? LFS3_I_REPOPGBMAP : 0,
|
||||
(ORPHANS >= 100) ? LFS3_I_REGBMAP : 0,
|
||||
0)
|
||||
| LFS3_I_COMPACTMETA
|
||||
| LFS3_I_CKMETA
|
||||
@ -441,16 +441,16 @@ code = '''
|
||||
lfs3_mount(&lfs3,
|
||||
LFS3_M_RDWR
|
||||
| LFS3_M_MKCONSISTENT
|
||||
| ((REPOPLOOKAHEAD) ? LFS3_M_REPOPLOOKAHEAD : 0)
|
||||
| ((RELOOKAHEAD) ? LFS3_M_RELOOKAHEAD : 0)
|
||||
| ((COMPACTMETA) ? LFS3_M_COMPACTMETA : 0)
|
||||
| ((CKMETA) ? LFS3_M_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS3_M_CKDATA : 0),
|
||||
CFG) => 0;
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
((!REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0)
|
||||
((!RELOOKAHEAD) ? LFS3_I_RELOOKAHEAD : 0)
|
||||
| LFS3_IFDEF_YES_GBMAP(
|
||||
(ORPHANS >= 100) ? LFS3_I_REPOPGBMAP : 0,
|
||||
(ORPHANS >= 100) ? LFS3_I_REGBMAP : 0,
|
||||
0)
|
||||
| ((!COMPACTMETA) ? LFS3_I_COMPACTMETA : 0)
|
||||
// note ckdata implies ckmeta
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user