diff --git a/lfs3.c b/lfs3.c index 590d2fbf..7bcf3d63 100644 --- a/lfs3.c +++ b/lfs3.c @@ -7408,10 +7408,10 @@ static inline bool lfs3_t_isrepopgbmap(uint32_t flags) { #endif } -static inline bool lfs3_t_iscompact(uint32_t flags) { +static inline bool lfs3_t_compactmeta(uint32_t flags) { (void)flags; #ifndef LFS3_RDONLY - return flags & LFS3_T_COMPACT; + return flags & LFS3_T_COMPACTMETA; #else return false; #endif @@ -9776,7 +9776,7 @@ static int lfs3_mdir_commit_(lfs3_t *lfs3, lfs3_mdir_t *mdir, // we may have touched any number of mdirs, so assume uncompacted // until lfs3_fs_gc can prove otherwise - lfs3->flags |= LFS3_I_COMPACT; + lfs3->flags |= LFS3_I_COMPACTMETA; #ifdef LFS3_DBGMDIRCOMMITS LFS3_DEBUG("Committed mdir %"PRId32" " @@ -10733,12 +10733,12 @@ dropped:; } // compacting mdirs? - if (lfs3_t_iscompact(mgc->t.b.h.flags) + if (lfs3_t_compactmeta(mgc->t.b.h.flags) && tag == LFS3_TAG_MDIR // exceed compaction threshold? && lfs3_rbyd_eoff(&((lfs3_mdir_t*)bptr_->d.u.buffer)->r) - > ((lfs3->cfg->gc_compact_thresh) - ? lfs3->cfg->gc_compact_thresh + > ((lfs3->cfg->gc_compactmeta_thresh) + ? lfs3->cfg->gc_compactmeta_thresh : lfs3->cfg->block_size - lfs3->cfg->block_size/8)) { lfs3_mdir_t *mdir = (lfs3_mdir_t*)bptr_->d.u.buffer; LFS3_INFO("Compacting mdir %"PRId32" 0x{%"PRIx32",%"PRIx32"} " @@ -10747,8 +10747,8 @@ dropped:; mdir->r.blocks[0], mdir->r.blocks[1], lfs3_rbyd_eoff(&mdir->r), - (lfs3->cfg->gc_compact_thresh) - ? lfs3->cfg->gc_compact_thresh + (lfs3->cfg->gc_compactmeta_thresh) + ? lfs3->cfg->gc_compactmeta_thresh : lfs3->cfg->block_size - lfs3->cfg->block_size/8); // compact the mdir uint32_t dirty = mgc->t.b.h.flags; @@ -10792,9 +10792,9 @@ eot:; // was compaction successful? note we may need multiple passes if // we want to be sure everything is compacted - if (lfs3_t_iscompact(mgc->t.b.h.flags) + if (lfs3_t_compactmeta(mgc->t.b.h.flags) && !lfs3_t_ismutated(mgc->t.b.h.flags)) { - lfs3->flags &= ~LFS3_I_COMPACT; + lfs3->flags &= ~LFS3_I_COMPACTMETA; } #endif @@ -15446,18 +15446,18 @@ static int lfs3_init(lfs3_t *lfs3, uint32_t flags, LFS3_GC_MKCONSISTENT | LFS3_GC_REPOPLOOKAHEAD | LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, 0) - | LFS3_GC_COMPACT + | LFS3_GC_COMPACTMETA | LFS3_GC_CKMETA | LFS3_GC_CKDATA)) == 0); - // check that gc_compact_thresh makes sense + // check that gc_compactmeta_thresh makes sense // // metadata can't be compacted below block_size/2, and metadata can't // exceed a block - LFS3_ASSERT(lfs3->cfg->gc_compact_thresh == 0 - || lfs3->cfg->gc_compact_thresh >= lfs3->cfg->block_size/2); - LFS3_ASSERT(lfs3->cfg->gc_compact_thresh == (lfs3_size_t)-1 - || lfs3->cfg->gc_compact_thresh <= lfs3->cfg->block_size); + LFS3_ASSERT(lfs3->cfg->gc_compactmeta_thresh == 0 + || lfs3->cfg->gc_compactmeta_thresh >= lfs3->cfg->block_size/2); + LFS3_ASSERT(lfs3->cfg->gc_compactmeta_thresh == (lfs3_size_t)-1 + || lfs3->cfg->gc_compactmeta_thresh <= lfs3->cfg->block_size); #endif #ifndef LFS3_RDONLY @@ -15476,7 +15476,7 @@ static int lfs3_init(lfs3_t *lfs3, uint32_t flags, | LFS3_IFDEF_RDONLY(0, LFS3_I_REPOPLOOKAHEAD) // 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_COMPACT) + | LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACTMETA) // default to needing a ckmeta/ckdata scan | LFS3_I_CKMETA | LFS3_I_CKDATA; @@ -16349,8 +16349,8 @@ int lfs3_mount(lfs3_t *lfs3, uint32_t flags, #ifdef LFS3_YES_REPOPGBMAP flags |= LFS3_YES_REPOPGBMAP; #endif - #ifdef LFS3_YES_COMPACT - flags |= LFS3_M_COMPACT; + #ifdef LFS3_YES_COMPACTMETA + flags |= LFS3_M_COMPACTMETA; #endif #ifdef LFS3_YES_CKMETA flags |= LFS3_M_CKMETA; @@ -16375,14 +16375,14 @@ int lfs3_mount(lfs3_t *lfs3, uint32_t flags, | LFS3_IFDEF_RDONLY(0, LFS3_M_REPOPLOOKAHEAD) | LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_M_REPOPGBMAP, 0)) - | LFS3_IFDEF_RDONLY(0, LFS3_M_COMPACT) + | 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_iscompact(flags)); + LFS3_ASSERT(!lfs3_m_isrdonly(flags) || !lfs3_t_compactmeta(flags)); int err = lfs3_init(lfs3, flags & ( @@ -16412,7 +16412,7 @@ int lfs3_mount(lfs3_t *lfs3, uint32_t flags, | LFS3_IFDEF_RDONLY(0, LFS3_M_REPOPLOOKAHEAD) | LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_M_REPOPGBMAP, 0)) - | LFS3_IFDEF_RDONLY(0, LFS3_M_COMPACT) + | LFS3_IFDEF_RDONLY(0, LFS3_M_COMPACTMETA) | LFS3_M_CKMETA | LFS3_M_CKDATA)) { lfs3_mgc_t mgc; @@ -16422,7 +16422,7 @@ int lfs3_mount(lfs3_t *lfs3, uint32_t flags, | LFS3_IFDEF_RDONLY(0, LFS3_M_REPOPLOOKAHEAD) | LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_M_REPOPGBMAP, 0)) - | LFS3_IFDEF_RDONLY(0, LFS3_M_COMPACT) + | LFS3_IFDEF_RDONLY(0, LFS3_M_COMPACTMETA) | LFS3_M_CKMETA | LFS3_M_CKDATA), -1); @@ -16766,7 +16766,7 @@ int lfs3_fs_stat(lfs3_t *lfs3, struct lfs3_fsinfo *fsinfo) { | LFS3_IFDEF_RDONLY(0, LFS3_I_REPOPLOOKAHEAD) | LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, 0)) - | LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACT) + | LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACTMETA) | LFS3_I_CKMETA | LFS3_I_CKDATA | LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, 0)); @@ -17035,7 +17035,7 @@ static int lfs3_fs_gc_(lfs3_t *lfs3, lfs3_mgc_t *mgc, | LFS3_IFDEF_RDONLY(0, LFS3_T_REPOPLOOKAHEAD) | LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, 0)) - | LFS3_IFDEF_RDONLY(0, LFS3_T_COMPACT) + | LFS3_IFDEF_RDONLY(0, LFS3_T_COMPACTMETA) | LFS3_T_CKMETA | LFS3_T_CKDATA)) == 0); // these flags require a writable filesystem @@ -17043,7 +17043,7 @@ static int lfs3_fs_gc_(lfs3_t *lfs3, lfs3_mgc_t *mgc, LFS3_ASSERT(!lfs3_m_isrdonly(lfs3->flags) || !lfs3_t_isrepoplookahead(flags)); LFS3_ASSERT(!lfs3_m_isrdonly(lfs3->flags) || !lfs3_t_isrepopgbmap(flags)); - LFS3_ASSERT(!lfs3_m_isrdonly(lfs3->flags) || !lfs3_t_iscompact(flags)); + LFS3_ASSERT(!lfs3_m_isrdonly(lfs3->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)); @@ -17067,7 +17067,7 @@ static int lfs3_fs_gc_(lfs3_t *lfs3, lfs3_mgc_t *mgc, | LFS3_IFDEF_RDONLY(0, LFS3_I_REPOPLOOKAHEAD) | LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, 0)) - | LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACT) + | LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACTMETA) | LFS3_I_CKMETA | LFS3_I_CKDATA))); @@ -17094,7 +17094,7 @@ static int lfs3_fs_gc_(lfs3_t *lfs3, lfs3_mgc_t *mgc, | LFS3_IFDEF_RDONLY(0, LFS3_T_REPOPLOOKAHEAD) | LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, 0)) - | LFS3_IFDEF_RDONLY(0, LFS3_T_COMPACT) + | LFS3_IFDEF_RDONLY(0, LFS3_T_COMPACTMETA) | LFS3_T_CKMETA | LFS3_T_CKDATA))) { lfs3_handle_close(lfs3, &mgc->t.b.h); @@ -17129,7 +17129,7 @@ static int lfs3_fs_gc_(lfs3_t *lfs3, lfs3_mgc_t *mgc, | LFS3_IFDEF_RDONLY(0, LFS3_I_REPOPLOOKAHEAD) | LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, 0)) - | LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACT) + | LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACTMETA) | LFS3_I_CKMETA | LFS3_I_CKDATA); } @@ -17164,7 +17164,7 @@ int lfs3_fs_unck(lfs3_t *lfs3, uint32_t flags) { | LFS3_IFDEF_RDONLY(0, LFS3_I_REPOPLOOKAHEAD) | LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, 0)) - | LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACT) + | LFS3_IFDEF_RDONLY(0, LFS3_I_COMPACTMETA) | LFS3_I_CKMETA | LFS3_I_CKDATA)) == 0); @@ -17396,7 +17396,7 @@ int lfs3_trv_open(lfs3_t *lfs3, lfs3_trv_t *trv, uint32_t flags) { | LFS3_IFDEF_RDONLY(0, LFS3_T_REPOPLOOKAHEAD) | LFS3_IFDEF_RDONLY(0, LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, 0)) - | LFS3_IFDEF_RDONLY(0, LFS3_T_COMPACT) + | LFS3_IFDEF_RDONLY(0, LFS3_T_COMPACTMETA) | LFS3_T_CKMETA | LFS3_T_CKDATA)) == 0); // writeable traversals require a writeable filesystem @@ -17405,7 +17405,7 @@ int lfs3_trv_open(lfs3_t *lfs3, lfs3_trv_t *trv, uint32_t flags) { 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_iscompact(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)); diff --git a/lfs3.h b/lfs3.h index ebdf84e9..6a6c3224 100644 --- a/lfs3.h +++ b/lfs3.h @@ -241,7 +241,8 @@ enum lfs3_type { 0x00000400 // Repopulate the gbmap #endif #ifndef LFS3_RDONLY -#define LFS3_M_COMPACT 0x00000800 // Compact metadata logs +#define LFS3_M_COMPACTMETA \ + 0x00000800 // Compact metadata logs #endif #define LFS3_M_CKMETA 0x00001000 // Check metadata checksums #define LFS3_M_CKDATA 0x00002000 // Check metadata + data checksums @@ -286,7 +287,8 @@ enum lfs3_type { 0x00000400 // The gbmap is not full #endif #ifndef LFS3_RDONLY -#define LFS3_I_COMPACT 0x00000800 // Filesystem may have uncompacted metadata +#define LFS3_I_COMPACTMETA \ + 0x00000800 // Filesystem may have uncompacted metadata #endif #define LFS3_I_CKMETA 0x00001000 // Metadata checksums not checked recently #define LFS3_I_CKDATA 0x00002000 // Data checksums not checked recently @@ -331,7 +333,8 @@ enum lfs3_btype { 0x00000400 // Repopulate the gbmap #endif #ifndef LFS3_RDONLY -#define LFS3_T_COMPACT 0x00000800 // Compact metadata logs +#define LFS3_T_COMPACTMETA \ + 0x00000800 // Compact metadata logs #endif #define LFS3_T_CKMETA 0x00001000 // Check metadata checksums #define LFS3_T_CKDATA 0x00002000 // Check metadata + data checksums @@ -360,7 +363,8 @@ enum lfs3_btype { 0x00000400 // Repopulate the gbmap #endif #ifndef LFS3_RDONLY -#define LFS3_GC_COMPACT 0x00000800 // Compact metadata logs +#define LFS3_GC_COMPACTMETA \ + 0x00000800 // Compact metadata logs #endif #define LFS3_GC_CKMETA 0x00001000 // Check metadata checksums #define LFS3_GC_CKDATA 0x00002000 // Check metadata + data checksums @@ -493,7 +497,7 @@ struct lfs3_cfg { // // Set to -1 to disable metadata compaction during gc. #ifndef LFS3_RDONLY - lfs3_size_t gc_compact_thresh; + lfs3_size_t gc_compactmeta_thresh; #endif // Optional statically allocated rcache buffer. Must be rcache_size. By diff --git a/runners/bench_runner.h b/runners/bench_runner.h index 149aa750..e46b2a3a 100644 --- a/runners/bench_runner.h +++ b/runners/bench_runner.h @@ -116,7 +116,7 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size); BENCH_DEFINE(LOOKAHEAD_SIZE, 16 ) \ BENCH_DEFINE(GC_FLAGS, 0 ) \ BENCH_DEFINE(GC_STEPS, 0 ) \ - BENCH_DEFINE(GC_COMPACT_THRESH, 0 ) \ + 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 ) \ @@ -136,20 +136,20 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size); // map defines to cfg struct fields #define BENCH_CFG \ - .read_size = READ_SIZE, \ - .prog_size = PROG_SIZE, \ - .block_size = BLOCK_SIZE, \ - .block_count = BLOCK_COUNT, \ - .block_recycles = BLOCK_RECYCLES, \ - .rcache_size = RCACHE_SIZE, \ - .pcache_size = PCACHE_SIZE, \ - .file_cache_size = FILE_CACHE_SIZE, \ - .lookahead_size = LOOKAHEAD_SIZE, \ - BENCH_GBMAP_CFG \ - BENCH_GC_CFG \ - .gc_compact_thresh = GC_COMPACT_THRESH, \ - .shrub_size = SHRUB_SIZE, \ - .fragment_size = FRAGMENT_SIZE, \ + .read_size = READ_SIZE, \ + .prog_size = PROG_SIZE, \ + .block_size = BLOCK_SIZE, \ + .block_count = BLOCK_COUNT, \ + .block_recycles = BLOCK_RECYCLES, \ + .rcache_size = RCACHE_SIZE, \ + .pcache_size = PCACHE_SIZE, \ + .file_cache_size = FILE_CACHE_SIZE, \ + .lookahead_size = LOOKAHEAD_SIZE, \ + BENCH_GBMAP_CFG \ + BENCH_GC_CFG \ + .gc_compactmeta_thresh = GC_COMPACTMETA_THRESH, \ + .shrub_size = SHRUB_SIZE, \ + .fragment_size = FRAGMENT_SIZE, \ .crystal_thresh = CRYSTAL_THRESH, #ifdef LFS3_GBMAP @@ -161,17 +161,17 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size); #ifdef LFS3_GC #define BENCH_GC_CFG \ - .gc_flags = GC_FLAGS, \ + .gc_flags = GC_FLAGS, \ .gc_steps = GC_STEPS, #else #define BENCH_GC_CFG #endif #define BENCH_BDCFG \ - .erase_value = ERASE_VALUE, \ - .erase_cycles = ERASE_CYCLES, \ - .badblock_behavior = BADBLOCK_BEHAVIOR, \ - .powerloss_behavior = POWERLOSS_BEHAVIOR, \ + .erase_value = ERASE_VALUE, \ + .erase_cycles = ERASE_CYCLES, \ + .badblock_behavior = BADBLOCK_BEHAVIOR, \ + .powerloss_behavior = POWERLOSS_BEHAVIOR, \ .seed = EMUBD_SEED, diff --git a/runners/test_runner.h b/runners/test_runner.h index c0a72914..832cabc9 100644 --- a/runners/test_runner.h +++ b/runners/test_runner.h @@ -107,7 +107,7 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size); TEST_DEFINE(LOOKAHEAD_SIZE, 16 ) \ TEST_DEFINE(GC_FLAGS, 0 ) \ TEST_DEFINE(GC_STEPS, 0 ) \ - TEST_DEFINE(GC_COMPACT_THRESH, 0 ) \ + 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 ) \ @@ -127,20 +127,20 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size); // map defines to cfg struct fields #define TEST_CFG \ - .read_size = READ_SIZE, \ - .prog_size = PROG_SIZE, \ - .block_size = BLOCK_SIZE, \ - .block_count = BLOCK_COUNT, \ - .block_recycles = BLOCK_RECYCLES, \ - .rcache_size = RCACHE_SIZE, \ - .pcache_size = PCACHE_SIZE, \ - .file_cache_size = FILE_CACHE_SIZE, \ - .lookahead_size = LOOKAHEAD_SIZE, \ - TEST_GBMAP_CFG \ - TEST_GC_CFG \ - .gc_compact_thresh = GC_COMPACT_THRESH, \ - .shrub_size = SHRUB_SIZE, \ - .fragment_size = FRAGMENT_SIZE, \ + .read_size = READ_SIZE, \ + .prog_size = PROG_SIZE, \ + .block_size = BLOCK_SIZE, \ + .block_count = BLOCK_COUNT, \ + .block_recycles = BLOCK_RECYCLES, \ + .rcache_size = RCACHE_SIZE, \ + .pcache_size = PCACHE_SIZE, \ + .file_cache_size = FILE_CACHE_SIZE, \ + .lookahead_size = LOOKAHEAD_SIZE, \ + TEST_GBMAP_CFG \ + TEST_GC_CFG \ + .gc_compactmeta_thresh = GC_COMPACTMETA_THRESH, \ + .shrub_size = SHRUB_SIZE, \ + .fragment_size = FRAGMENT_SIZE, \ .crystal_thresh = CRYSTAL_THRESH, #ifdef LFS3_GBMAP @@ -152,17 +152,17 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size); #ifdef LFS3_GC #define TEST_GC_CFG \ - .gc_flags = GC_FLAGS, \ + .gc_flags = GC_FLAGS, \ .gc_steps = GC_STEPS, #else #define TEST_GC_CFG #endif #define TEST_BDCFG \ - .erase_value = ERASE_VALUE, \ - .erase_cycles = ERASE_CYCLES, \ - .badblock_behavior = BADBLOCK_BEHAVIOR, \ - .powerloss_behavior = POWERLOSS_BEHAVIOR, \ + .erase_value = ERASE_VALUE, \ + .erase_cycles = ERASE_CYCLES, \ + .badblock_behavior = BADBLOCK_BEHAVIOR, \ + .powerloss_behavior = POWERLOSS_BEHAVIOR, \ .seed = EMUBD_SEED, diff --git a/scripts/dbgflags.py b/scripts/dbgflags.py index ff5e6c97..d0357591 100755 --- a/scripts/dbgflags.py +++ b/scripts/dbgflags.py @@ -92,7 +92,7 @@ FLAGS = [ ('M_REPOPLOOKAHEAD', 0x00000200, "Repopulate lookahead buffer" ), ('M_REPOPGBMAP', 0x00000400, "Repopulate the gbmap" ), - ('M_COMPACT', 0x00000800, "Compact metadata logs" ), + ('M_COMPACTMETA', 0x00000800, "Compact metadata logs" ), ('M_CKMETA', 0x00001000, "Check metadata checksums" ), ('M_CKDATA', 0x00002000, "Check metadata + data checksums" ), @@ -101,7 +101,7 @@ FLAGS = [ ('GC_REPOPLOOKAHEAD', 0x00000200, "Repopulate lookahead buffer" ), ('GC_REPOPGBMAP', 0x00000400, "Repopulate the gbmap" ), - ('GC_COMPACT', 0x00000800, "Compact metadata logs" ), + ('GC_COMPACTMETA', 0x00000800, "Compact metadata logs" ), ('GC_CKMETA', 0x00001000, "Check metadata checksums" ), ('GC_CKDATA', 0x00002000, "Check metadata + data checksums" ), @@ -120,7 +120,7 @@ FLAGS = [ ('I_REPOPLOOKAHEAD', 0x00000200, "Lookahead buffer is not full" ), ('I_REPOPGBMAP', 0x00000400, "The gbmap is not full" ), - ('I_COMPACT', 0x00000800, "Filesystem may have uncompacted metadata" ), + ('I_COMPACTMETA', 0x00000800, "Filesystem may have uncompacted metadata" ), ('I_CKMETA', 0x00001000, "Metadata checksums not checked recently" ), ('I_CKDATA', 0x00002000, "Data checksums not checked recently" ), @@ -140,7 +140,7 @@ FLAGS = [ ('T_REPOPLOOKAHEAD', 0x00000200, "Repopulate lookahead buffer" ), ('T_REPOPGBMAP', 0x00000400, "Repopulate the gbmap" ), - ('T_COMPACT', 0x00000800, "Compact metadata logs" ), + ('T_COMPACTMETA', 0x00000800, "Compact metadata logs" ), ('T_CKMETA', 0x00001000, "Check metadata checksums" ), ('T_CKDATA', 0x00002000, "Check metadata + data checksums" ), diff --git a/tests/test_attrs.toml b/tests/test_attrs.toml index 364e3099..aab1dcb5 100644 --- a/tests/test_attrs.toml +++ b/tests/test_attrs.toml @@ -910,11 +910,11 @@ code = ''' defines.FILETYPE = [0, 1, 2, 3] defines.M = 40 defines.SIZE = 4 -defines.COMPACT = [false, true] -defines.GC_FLAGS = 'LFS3_GC_COMPACT' +defines.COMPACTMETA = [false, true] +defines.GC_FLAGS = 'LFS3_GC_COMPACTMETA' defines.GC_STEPS = -1 -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' -if = 'LFS3_IFDEF_GC(true, !COMPACT)' +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' +if = 'LFS3_IFDEF_GC(true, !COMPACTMETA)' code = ''' lfs3_t lfs3; lfs3_format(&lfs3, LFS3_F_RDWR, CFG) => 0; @@ -958,7 +958,7 @@ code = ''' // try compacting? #ifdef LFS3_GC - if (COMPACT) { + if (COMPACTMETA) { lfs3_fs_gc(&lfs3) => 0; } #endif @@ -1004,11 +1004,11 @@ defines.FILETYPE = [0, 1, 2] defines.N = 64 defines.M = 4 defines.SIZE = 4 -defines.COMPACT = [false, true] -defines.GC_FLAGS = 'LFS3_GC_COMPACT' +defines.COMPACTMETA = [false, true] +defines.GC_FLAGS = 'LFS3_GC_COMPACTMETA' defines.GC_STEPS = -1 -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' -if = 'LFS3_IFDEF_GC(true, !COMPACT)' +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' +if = 'LFS3_IFDEF_GC(true, !COMPACTMETA)' code = ''' lfs3_t lfs3; lfs3_format(&lfs3, LFS3_F_RDWR, CFG) => 0; @@ -1055,7 +1055,7 @@ code = ''' // try compacting? #ifdef LFS3_GC - if (COMPACT) { + if (COMPACTMETA) { lfs3_fs_gc(&lfs3) => 0; } #endif @@ -5041,11 +5041,11 @@ code = ''' defines.N = 64 defines.M = 4 defines.SIZE = 4 -defines.COMPACT = [false, true] -defines.GC_FLAGS = 'LFS3_GC_COMPACT' +defines.COMPACTMETA = [false, true] +defines.GC_FLAGS = 'LFS3_GC_COMPACTMETA' defines.GC_STEPS = -1 -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' -if = 'LFS3_IFDEF_GC(true, !COMPACT)' +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' +if = 'LFS3_IFDEF_GC(true, !COMPACTMETA)' code = ''' lfs3_t lfs3; lfs3_format(&lfs3, LFS3_F_RDWR, CFG) => 0; @@ -5083,7 +5083,7 @@ code = ''' // try compacting? #ifdef LFS3_GC - if (COMPACT) { + if (COMPACTMETA) { lfs3_fs_gc(&lfs3) => 0; } #endif diff --git a/tests/test_gc.toml b/tests/test_gc.toml index dfb9af42..de3d7ca7 100644 --- a/tests/test_gc.toml +++ b/tests/test_gc.toml @@ -315,20 +315,20 @@ code = ''' ''' -# test that compact can make progress in isolation -[cases.test_gc_compact_progress] +# test that compactmeta can make progress in isolation +[cases.test_gc_compactmeta_progress] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.GC_FLAGS = ''' - LFS3_GC_COMPACT + LFS3_GC_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.SIZE = [ 'FILE_CACHE_SIZE/2', '2*FILE_CACHE_SIZE', @@ -348,14 +348,14 @@ code = ''' uint32_t prng = 42; - // write to our mdir until >gc_compact_thresh full + // write to our mdir until >gc_compactmeta_thresh full lfs3_file_t file; lfs3_file_open(&lfs3, &file, "jellyfish", LFS3_O_RDWR | LFS3_O_CREAT | LFS3_O_EXCL) => 0; // hack, don't use the internals like this uint8_t wbuf[SIZE]; - while ((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -367,7 +367,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_COMPACT); + assert(fsinfo.flags & LFS3_I_COMPACTMETA); assert(lfs3.handles != &lfs3.gc.gc.t.b.h); // run GC until we make progress @@ -378,13 +378,13 @@ code = ''' lfs3_fs_gc(&lfs3) => 0; lfs3_fs_stat(&lfs3, &fsinfo) => 0; - if (!(fsinfo.flags & LFS3_I_COMPACT)) { + if (!(fsinfo.flags & LFS3_I_COMPACTMETA)) { break; } } // mdir should have been compacted - assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // check we can still read the file for (int remount = 0; remount < 2; remount++) { @@ -406,19 +406,19 @@ code = ''' lfs3_unmount(&lfs3) => 0; ''' -# test that compact dirtying still works with the GC API -[cases.test_gc_compact_mutation] +# test that compactmeta dirtying still works with the GC API +[cases.test_gc_compactmeta_mutation] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.GC_FLAGS = ''' - LFS3_GC_COMPACT + LFS3_GC_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.SIZE = [ 'FILE_CACHE_SIZE/2', '2*FILE_CACHE_SIZE', @@ -440,14 +440,14 @@ code = ''' uint32_t prng = 42; - // write to our mdir until >gc_compact_thresh full + // write to our mdir until >gc_compactmeta_thresh full lfs3_file_t file; lfs3_file_open(&lfs3, &file, "jellyfish", LFS3_O_RDWR | LFS3_O_CREAT | LFS3_O_EXCL) => 0; // hack, don't use the internals like this uint8_t wbuf[SIZE]; - while ((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -459,7 +459,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_COMPACT); + assert(fsinfo.flags & LFS3_I_COMPACTMETA); assert(lfs3.handles != &lfs3.gc.gc.t.b.h); // run GC one traversal + one step @@ -482,14 +482,14 @@ code = ''' lfs3_file_write(&lfs3, &file, wbuf, SIZE) => SIZE; lfs3_file_sync(&lfs3, &file) => 0; - // run GC until our traversal is done (twice for compact) + // run GC until our traversal is done (twice for compactmeta) while (lfs3.handles == &lfs3.gc.gc.t.b.h) { lfs3_fs_gc(&lfs3) => 0; } // we should _not_ make progress lfs3_fs_stat(&lfs3, &fsinfo) => 0; - assert(fsinfo.flags & LFS3_I_COMPACT); + assert(fsinfo.flags & LFS3_I_COMPACTMETA); // check we can still read the file for (int remount = 0; remount < 2; remount++) { @@ -515,13 +515,13 @@ code = ''' # test that mkconsistent can make progress in isolation [cases.test_gc_mkconsistent_progress] defines.REPOPLOOKAHEAD = [false, true] -defines.COMPACT = [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) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' @@ -733,13 +733,13 @@ code = ''' # test that mkconsistent dirtying still works with the GC API [cases.test_gc_mkconsistent_mutation] defines.REPOPLOOKAHEAD = [false, true] -defines.COMPACT = [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) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' @@ -1600,14 +1600,14 @@ defines.AFTER = [0, 1, 2, 3] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [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) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' @@ -1667,7 +1667,7 @@ code = ''' ? (LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) & fsinfo.flags) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -1691,7 +1691,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_I_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) | ((CKMETA) ? LFS3_I_CKMETA : 0) | ((CKDATA) ? LFS3_I_CKDATA : 0)))) { break; @@ -1723,7 +1723,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_I_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) | ((CKMETA) ? LFS3_I_CKMETA : 0) | ((CKDATA) ? LFS3_I_CKDATA : 0)))) { break; @@ -1767,11 +1767,11 @@ code = ''' } #endif - if (COMPACT && (fsinfo.flags & LFS3_I_COMPACT)) { + if (COMPACTMETA && (fsinfo.flags & LFS3_I_COMPACTMETA)) { // we need an explicit traversal for this lfs3_trv_t trv; lfs3_trv_open(&lfs3, &trv, - LFS3_T_RDWR | LFS3_T_COMPACT) => 0; + LFS3_T_RDWR | LFS3_T_COMPACTMETA) => 0; while (true) { struct lfs3_tinfo tinfo; int err = lfs3_trv_read(&lfs3, &trv, &tinfo); @@ -1812,7 +1812,7 @@ code = ''' & fsinfo.flags) : 0) : 0) - | ((!COMPACT) ? LFS3_I_COMPACT : 0) + | ((!COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) // note ckdata implies ckmeta | ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0) | ((!CKDATA) ? LFS3_I_CKDATA : 0) @@ -1831,14 +1831,14 @@ defines.AFTER = [0, 1, 2, 3] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [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) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' @@ -1898,7 +1898,7 @@ code = ''' ? (LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) & fsinfo.flags) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -1922,7 +1922,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_I_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) | ((CKMETA) ? LFS3_I_CKMETA : 0) | ((CKDATA) ? LFS3_I_CKDATA : 0)))) { break; @@ -1954,7 +1954,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_I_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) | ((CKMETA) ? LFS3_I_CKMETA : 0) | ((CKDATA) ? LFS3_I_CKDATA : 0)))) { break; @@ -1998,11 +1998,11 @@ code = ''' } #endif - if (COMPACT && (fsinfo.flags & LFS3_I_COMPACT)) { + if (COMPACTMETA && (fsinfo.flags & LFS3_I_COMPACTMETA)) { // we need an explicit traversal for this lfs3_trv_t trv; lfs3_trv_open(&lfs3, &trv, - LFS3_T_RDWR | LFS3_T_COMPACT) => 0; + LFS3_T_RDWR | LFS3_T_COMPACTMETA) => 0; while (true) { struct lfs3_tinfo tinfo; int err = lfs3_trv_read(&lfs3, &trv, &tinfo); @@ -2043,7 +2043,7 @@ code = ''' & fsinfo.flags) : 0) : 0) - | ((!COMPACT) ? LFS3_I_COMPACT : 0) + | ((!COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) // note ckdata implies ckmeta | ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0) | ((!CKDATA) ? LFS3_I_CKDATA : 0) @@ -2063,7 +2063,7 @@ code = ''' ? (LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) & fsinfo.flags) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta, but uncking ckdata does // _not_ imply uncking ckmeta | ((!(CKDATA && !CKMETA)) ? LFS3_I_CKMETA : 0) @@ -2089,7 +2089,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_I_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) | ((CKMETA) ? LFS3_I_CKMETA : 0) | ((CKDATA) ? LFS3_I_CKDATA : 0)))) { break; @@ -2121,7 +2121,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_I_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) | ((CKMETA) ? LFS3_I_CKMETA : 0) | ((CKDATA) ? LFS3_I_CKDATA : 0)))) { break; @@ -2165,11 +2165,11 @@ code = ''' } #endif - if (COMPACT && (fsinfo.flags & LFS3_I_COMPACT)) { + if (COMPACTMETA && (fsinfo.flags & LFS3_I_COMPACTMETA)) { // we need an explicit traversal for this lfs3_trv_t trv; lfs3_trv_open(&lfs3, &trv, - LFS3_T_RDWR | LFS3_T_COMPACT) => 0; + LFS3_T_RDWR | LFS3_T_COMPACTMETA) => 0; while (true) { struct lfs3_tinfo tinfo; int err = lfs3_trv_read(&lfs3, &trv, &tinfo); @@ -2210,7 +2210,7 @@ code = ''' & fsinfo.flags) : 0) : 0) - | ((!COMPACT) ? LFS3_I_COMPACT : 0) + | ((!COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) // note ckdata implies ckmeta | ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0) | ((!CKDATA) ? LFS3_I_CKDATA : 0) @@ -2226,20 +2226,20 @@ defines.N = 100 defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [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) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.SIZE = [ 'FILE_CACHE_SIZE/2', '2*FILE_CACHE_SIZE', @@ -2301,20 +2301,20 @@ defines.N = 100 defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [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) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.SIZE = [ 'FILE_CACHE_SIZE/2', '2*FILE_CACHE_SIZE', @@ -2383,7 +2383,7 @@ code = ''' defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.UNCK = [false, true] @@ -2391,13 +2391,13 @@ defines.GC_FLAGS = ''' ((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0) | ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0) | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# 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' ifdef = 'LFS3_GC' @@ -2493,7 +2493,7 @@ code = ''' defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.UNCK = [false, true] @@ -2501,13 +2501,13 @@ defines.GC_FLAGS = ''' ((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0) | ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0) | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.OPS = '2*N' defines.SEED = 42 @@ -2674,7 +2674,7 @@ code = ''' defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.UNCK = [false, true] @@ -2682,13 +2682,13 @@ defines.GC_FLAGS = ''' ((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0) | ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0) | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.SIZE = [ '0', @@ -2780,7 +2780,7 @@ code = ''' defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.UNCK = [false, true] @@ -2788,13 +2788,13 @@ defines.GC_FLAGS = ''' ((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0) | ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0) | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' defines.SIZE = [ @@ -3025,7 +3025,7 @@ code = ''' defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.UNCK = [false, true] @@ -3033,13 +3033,13 @@ defines.GC_FLAGS = ''' ((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0) | ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0) | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.OPS = 20 defines.SIZE = [ 'FILE_CACHE_SIZE/2', @@ -3188,7 +3188,7 @@ code = ''' defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.UNCK = [false, true] @@ -3196,13 +3196,13 @@ defines.GC_FLAGS = ''' ((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0) | ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0) | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' defines.SIZE = [ @@ -3640,7 +3640,7 @@ code = ''' defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.UNCK = [false, true] @@ -3648,13 +3648,13 @@ defines.GC_FLAGS = ''' ((MKCONSISTENT) ? LFS3_GC_MKCONSISTENT : 0) | ((REPOPLOOKAHEAD) ? LFS3_GC_REPOPLOOKAHEAD : 0) | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_GC_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_GC_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_GC_COMPACTMETA : 0) | ((CKMETA) ? LFS3_GC_CKMETA : 0) | ((CKDATA) ? LFS3_GC_CKDATA : 0) ''' defines.GC_STEPS = [-1, 1, 2, 10, 100, 1000] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' defines.SIZE = [ diff --git a/tests/test_kv.toml b/tests/test_kv.toml index e658224d..8d6fbfbb 100644 --- a/tests/test_kv.toml +++ b/tests/test_kv.toml @@ -463,11 +463,11 @@ code = ''' [cases.test_kv_many] defines.N = [40, 400] defines.SIZE = 4 -defines.COMPACT = [false, true] -defines.GC_FLAGS = 'LFS3_GC_COMPACT' +defines.COMPACTMETA = [false, true] +defines.GC_FLAGS = 'LFS3_GC_COMPACTMETA' defines.GC_STEPS = -1 -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' -if = 'LFS3_IFDEF_GC(true, !COMPACT)' +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' +if = 'LFS3_IFDEF_GC(true, !COMPACTMETA)' code = ''' lfs3_t lfs3; lfs3_format(&lfs3, LFS3_F_RDWR, CFG) => 0; @@ -489,7 +489,7 @@ code = ''' // try compacting? #ifdef LFS3_GC - if (COMPACT) { + if (COMPACTMETA) { lfs3_fs_gc(&lfs3) => 0; } #endif @@ -633,11 +633,11 @@ code = ''' defines.N = 40 # size is more an upper limit here defines.SIZE = 40000 -defines.COMPACT = [false, true] -defines.GC_FLAGS = 'LFS3_GC_COMPACT' +defines.COMPACTMETA = [false, true] +defines.GC_FLAGS = 'LFS3_GC_COMPACTMETA' defines.GC_STEPS = -1 -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' -if = 'LFS3_IFDEF_GC(true, !COMPACT)' +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' +if = 'LFS3_IFDEF_GC(true, !COMPACTMETA)' code = ''' lfs3_t lfs3; lfs3_format(&lfs3, LFS3_F_RDWR, CFG) => 0; @@ -664,7 +664,7 @@ code = ''' // try compacting? #ifdef LFS3_GC - if (COMPACT) { + if (COMPACTMETA) { lfs3_fs_gc(&lfs3) => 0; } #endif diff --git a/tests/test_mount.toml b/tests/test_mount.toml index ca48ebf7..0b6cce6b 100644 --- a/tests/test_mount.toml +++ b/tests/test_mount.toml @@ -26,7 +26,7 @@ defines.CKDATACKSUMS = [false, true] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] if = [ @@ -41,7 +41,7 @@ if = [ '!RDONLY || !REPOPLOOKAHEAD', 'LFS3_IFDEF_YES_GBMAP(true, !REPOPGBMAP)', '!RDONLY || !REPOPGBMAP', - '!RDONLY || !COMPACT', + '!RDONLY || !COMPACTMETA', ] code = ''' lfs3_t lfs3; @@ -65,7 +65,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_M_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_M_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_M_COMPACTMETA : 0) | ((CKMETA) ? LFS3_M_CKMETA : 0) | ((CKDATA) ? LFS3_M_CKDATA : 0), CFG) => 0; @@ -89,7 +89,7 @@ code = ''' : 0) | ((!MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0) | ((!REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0) - | ((!COMPACT) ? LFS3_I_COMPACT : 0) + | ((!COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) // note ckdata implies ckmeta | ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0) | ((!CKDATA) ? LFS3_I_CKDATA : 0) @@ -147,7 +147,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_MKCONSISTENT | LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | LFS3_IFDEF_YES_GBMAP( @@ -174,7 +174,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_MKCONSISTENT | LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0))); @@ -190,7 +190,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_MKCONSISTENT - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0) | ((!CKDATA) ? LFS3_I_CKDATA : 0) @@ -221,7 +221,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_MKCONSISTENT | LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, 0))); @@ -244,7 +244,7 @@ code = ''' LFS3_I_MKCONSISTENT | LFS3_I_REPOPLOOKAHEAD | LFS3_I_REPOPGBMAP - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, 0))); @@ -261,7 +261,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_MKCONSISTENT - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0) | ((!CKDATA) ? LFS3_I_CKDATA : 0) @@ -269,7 +269,7 @@ code = ''' lfs3_unmount(&lfs3) => 0; ''' -[cases.test_mount_t_compact] +[cases.test_mount_t_compactmeta] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] @@ -281,8 +281,8 @@ defines.SIZE = [ '2*BLOCK_SIZE', '8*BLOCK_SIZE', ] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' code = ''' lfs3_t lfs3; lfs3_format(&lfs3, LFS3_F_RDWR, CFG) => 0; @@ -292,14 +292,14 @@ code = ''' // first lets create a compactable filesystem lfs3_mount(&lfs3, LFS3_M_RDWR, CFG) => 0; - // write to our mdir until >gc_compact_thresh full + // write to our mdir until >gc_compactmeta_thresh full lfs3_file_t file; lfs3_file_open(&lfs3, &file, "jellyfish", LFS3_O_WRONLY | LFS3_O_CREAT | LFS3_O_EXCL) => 0; // hack, don't use the internals like this uint8_t wbuf[SIZE]; - while ((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -321,16 +321,16 @@ code = ''' | LFS3_IFDEF_YES_GBMAP( (SIZE >= BLOCK_SIZE/4) ? LFS3_I_REPOPGBMAP : 0, 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0))); lfs3_unmount(&lfs3) => 0; - // with LFS3_M_COMPACT, mount compact any uncompacted blocks + // with LFS3_M_COMPACTMETA, mount compacts any uncompacted blocks lfs3_mount(&lfs3, LFS3_M_RDWR - | LFS3_M_COMPACT + | LFS3_M_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_M_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_M_CKMETA : 0) | ((CKDATA) ? LFS3_M_CKDATA : 0), @@ -349,7 +349,7 @@ code = ''' // mdir should have been compacted lfs3_file_open(&lfs3, &file, "jellyfish", LFS3_O_RDONLY) => 0; - assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // check we can still read the file uint8_t rbuf[SIZE]; @@ -362,7 +362,7 @@ code = ''' [cases.test_mount_t_mkconsistent] defines.REPOPLOOKAHEAD = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.SIZE = 'FILE_CACHE_SIZE/2' @@ -431,7 +431,7 @@ code = ''' | LFS3_IFDEF_YES_GBMAP( (ORPHANS >= 100) ? LFS3_I_REPOPGBMAP : 0, 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | LFS3_IFDEF_YES_GBMAP(LFS3_I_GBMAP, 0))); @@ -442,7 +442,7 @@ code = ''' LFS3_M_RDWR | LFS3_M_MKCONSISTENT | ((REPOPLOOKAHEAD) ? LFS3_M_REPOPLOOKAHEAD : 0) - | ((COMPACT) ? LFS3_M_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_M_COMPACTMETA : 0) | ((CKMETA) ? LFS3_M_CKMETA : 0) | ((CKDATA) ? LFS3_M_CKDATA : 0), CFG) => 0; @@ -452,7 +452,7 @@ code = ''' | LFS3_IFDEF_YES_GBMAP( (ORPHANS >= 100) ? LFS3_I_REPOPGBMAP : 0, 0) - | ((!COMPACT) ? LFS3_I_COMPACT : 0) + | ((!COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) // note ckdata implies ckmeta | ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0) | ((!CKDATA) ? LFS3_I_CKDATA : 0) diff --git a/tests/test_trvs.toml b/tests/test_trvs.toml index 4aa9a354..bfddd7f3 100644 --- a/tests/test_trvs.toml +++ b/tests/test_trvs.toml @@ -21,7 +21,7 @@ if = ''' defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] if = 'GBMAP || !REPOPGBMAP' @@ -42,7 +42,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; struct lfs3_tinfo tinfo; @@ -67,7 +67,7 @@ code = ''' [cases.test_trvs_rewind] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] code = ''' @@ -87,7 +87,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; struct lfs3_tinfo tinfo; @@ -127,7 +127,7 @@ code = ''' defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] if = 'GBMAP || !REPOPGBMAP' @@ -148,7 +148,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; struct lfs3_tinfo tinfo; @@ -1774,7 +1774,7 @@ done:; defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] if = 'GBMAP || !REPOPGBMAP' @@ -1792,7 +1792,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_MKCONSISTENT | LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -1806,7 +1806,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; struct lfs3_tinfo tinfo; @@ -1829,7 +1829,7 @@ code = ''' assert(fsinfo.flags == ( ((!MKCONSISTENT) ? LFS3_I_MKCONSISTENT : 0) | ((!REPOPLOOKAHEAD) ? LFS3_I_REPOPLOOKAHEAD : 0) - | ((!COMPACT) ? LFS3_I_COMPACT : 0) + | ((!COMPACTMETA) ? LFS3_I_COMPACTMETA : 0) // note ckdata implies ckmeta | ((!CKMETA && !CKDATA) ? LFS3_I_CKMETA : 0) | ((!CKDATA) ? LFS3_I_CKDATA : 0) @@ -1903,7 +1903,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -1964,7 +1964,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -1985,7 +1985,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2050,7 +2050,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2119,7 +2119,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2188,7 +2188,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2267,7 +2267,7 @@ code = ''' | ((GBMAP && SIZE >= BLOCK_SIZE/4) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2359,7 +2359,7 @@ code = ''' | ((GBMAP && SIZE >= BLOCK_SIZE/4) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2462,7 +2462,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2575,7 +2575,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2681,7 +2681,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2776,7 +2776,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2891,7 +2891,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -2999,7 +2999,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -3098,7 +3098,7 @@ code = ''' assert(fsinfo.flags == ( ((DESYNC) ? LFS3_I_MKCONSISTENT : 0) | ((!(REPOPLOOKAHEAD && DESYNC)) ? LFS3_I_REPOPLOOKAHEAD : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | ((!(CKMETA && DESYNC) && !(CKDATA && DESYNC)) ? LFS3_I_CKMETA @@ -3220,7 +3220,7 @@ code = ''' ((DESYNC) ? LFS3_I_MKCONSISTENT : 0) | ((!(REPOPLOOKAHEAD && DESYNC)) ? LFS3_I_REPOPLOOKAHEAD : 0) | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | ((!(CKMETA && DESYNC) && !(CKDATA && DESYNC)) ? LFS3_I_CKMETA @@ -3335,7 +3335,7 @@ code = ''' ((DESYNC) ? LFS3_I_MKCONSISTENT : 0) | ((!(REPOPLOOKAHEAD && DESYNC)) ? LFS3_I_REPOPLOOKAHEAD : 0) | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | ((!(CKMETA && DESYNC) && !(CKDATA && DESYNC)) ? LFS3_I_CKMETA @@ -3445,7 +3445,7 @@ code = ''' ((DESYNC) ? LFS3_I_MKCONSISTENT : 0) | ((!(REPOPLOOKAHEAD && DESYNC)) ? LFS3_I_REPOPLOOKAHEAD : 0) | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | ((!(CKMETA && DESYNC) && !(CKDATA && DESYNC)) ? LFS3_I_CKMETA @@ -3557,7 +3557,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -3666,7 +3666,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -3783,7 +3783,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -3911,7 +3911,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -4039,7 +4039,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -4154,7 +4154,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -4263,7 +4263,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -4387,7 +4387,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -4510,7 +4510,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -4686,7 +4686,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -4879,7 +4879,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -5066,7 +5066,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -5250,7 +5250,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -5441,7 +5441,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -5631,7 +5631,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -5832,7 +5832,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -5865,13 +5865,13 @@ code = ''' # test traversals with mdir compaction -[cases.test_trvs_compact] +[cases.test_trvs_compactmeta] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.SIZE = 'FILE_CACHE_SIZE/2' -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' code = ''' lfs3_t lfs3; lfs3_format(&lfs3, @@ -5882,14 +5882,14 @@ code = ''' uint32_t prng = 42; - // write to our mdir until >gc_compact_thresh full + // write to our mdir until >gc_compactmeta_thresh full lfs3_file_t file; lfs3_file_open(&lfs3, &file, "jellyfish", LFS3_O_RDWR | LFS3_O_CREAT | LFS3_O_EXCL) => 0; // hack, don't use the internals like this uint8_t wbuf[SIZE]; - while ((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -5903,7 +5903,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -5912,7 +5912,7 @@ code = ''' lfs3_trv_t trv; lfs3_trv_open(&lfs3, &trv, LFS3_T_RDWR - | LFS3_T_COMPACT + | LFS3_T_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_T_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -5932,13 +5932,13 @@ code = ''' lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT; // mdir should have been compacted - assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // but because we mutated, we're still marked as uncompacted lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -5955,7 +5955,7 @@ code = ''' lfs3_trv_close(&lfs3, &trv) => 0; // mdir should have been compacted - assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // uncompacted flag should have been cleared lfs3_fs_stat(&lfs3, &fsinfo) => 0; @@ -5986,13 +5986,13 @@ code = ''' lfs3_unmount(&lfs3) => 0; ''' -[cases.test_trvs_compact_mrootchain] +[cases.test_trvs_compactmeta_mrootchain] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.SIZE = 'FILE_CACHE_SIZE/2' -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' # force early relocations defines.BLOCK_RECYCLES = 0 in = 'lfs3.c' @@ -6022,13 +6022,13 @@ code = ''' lfs3_file_sync(&lfs3, &file) => 0; } - // now write to our mdir until mrootanchor >gc_compact_thresh full + // now write to our mdir until mrootanchor >gc_compactmeta_thresh full while (true) { // we need internals to check this lfs3_mdir_t mrootanchor; lfs3_mdir_fetch(&lfs3, &mrootanchor, -1, LFS3_MPTR_MROOTANCHOR()) => 0; - if (lfs3_rbyd_eoff(&mrootanchor.r) > GC_COMPACT_THRESH) { + if (lfs3_rbyd_eoff(&mrootanchor.r) > GC_COMPACTMETA_THRESH) { break; } @@ -6046,7 +6046,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -6055,7 +6055,7 @@ code = ''' lfs3_trv_t trv; lfs3_trv_open(&lfs3, &trv, LFS3_T_RDWR - | LFS3_T_COMPACT + | LFS3_T_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_T_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -6083,14 +6083,14 @@ code = ''' lfs3_mdir_t mrootanchor; lfs3_mdir_fetch(&lfs3, &mrootanchor, -1, LFS3_MPTR_MROOTANCHOR()) => 0; - assert(lfs3_rbyd_eoff(&mrootanchor.r) <= GC_COMPACT_THRESH); + assert(lfs3_rbyd_eoff(&mrootanchor.r) <= GC_COMPACTMETA_THRESH); // but because we mutated, we're still marked as uncompacted lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -6109,7 +6109,7 @@ code = ''' // mrootanchor should have been compacted lfs3_mdir_fetch(&lfs3, &mrootanchor, -1, LFS3_MPTR_MROOTANCHOR()) => 0; - assert(lfs3_rbyd_eoff(&mrootanchor.r) <= GC_COMPACT_THRESH); + assert(lfs3_rbyd_eoff(&mrootanchor.r) <= GC_COMPACTMETA_THRESH); // uncompacted flag should have been cleared lfs3_fs_stat(&lfs3, &fsinfo) => 0; @@ -6141,13 +6141,13 @@ code = ''' lfs3_unmount(&lfs3) => 0; ''' -[cases.test_trvs_compact_mroot_extend] +[cases.test_trvs_compactmeta_mroot_extend] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.SIZE = 'FILE_CACHE_SIZE/2' -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' # force early relocations defines.BLOCK_RECYCLES = 0 in = 'lfs3.c' @@ -6161,14 +6161,14 @@ code = ''' uint32_t prng = 42; - // write to our mdir until >gc_compact_thresh full + // write to our mdir until >gc_compactmeta_thresh full lfs3_file_t file; lfs3_file_open(&lfs3, &file, "jellyfish", LFS3_O_RDWR | LFS3_O_CREAT | LFS3_O_EXCL) => 0; // hack, don't use the internals like this uint8_t wbuf[SIZE]; - while ((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -6182,7 +6182,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -6191,7 +6191,7 @@ code = ''' lfs3_trv_t trv; lfs3_trv_open(&lfs3, &trv, LFS3_T_RDWR - | LFS3_T_COMPACT + | LFS3_T_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_T_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -6213,14 +6213,14 @@ code = ''' lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT; // mdir should have been compacted - assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // but because we mutated, we're still marked as uncompacted lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -6237,7 +6237,7 @@ code = ''' lfs3_trv_close(&lfs3, &trv) => 0; // mdir should have been compacted - assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // uncompacted flag should have been cleared lfs3_fs_stat(&lfs3, &fsinfo) => 0; @@ -6269,13 +6269,13 @@ code = ''' lfs3_unmount(&lfs3) => 0; ''' -[cases.test_trvs_compact_mroot_split] +[cases.test_trvs_compactmeta_mroot_split] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.SIZE = 'FILE_CACHE_SIZE/2' -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' in = 'lfs3.c' code = ''' lfs3_t lfs3; @@ -6318,7 +6318,7 @@ code = ''' &file1.b.h.mdir, -1, -1, NULL); assert(estimate >= 0); - if ((file1.b.h.mdir.r.eoff & 0x7fffffff) > GC_COMPACT_THRESH + if ((file1.b.h.mdir.r.eoff & 0x7fffffff) > GC_COMPACTMETA_THRESH && estimate > BLOCK_SIZE/2) { break; } @@ -6337,7 +6337,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -6346,7 +6346,7 @@ code = ''' lfs3_trv_t trv; lfs3_trv_open(&lfs3, &trv, LFS3_T_RDWR - | LFS3_T_COMPACT + | LFS3_T_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_T_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -6379,15 +6379,15 @@ code = ''' lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT; // mdirs should have been compacted - assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // but because we mutated, we're still marked as uncompacted lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -6404,8 +6404,8 @@ code = ''' lfs3_trv_close(&lfs3, &trv) => 0; // mdirs should have been compacted - assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // uncompacted flag should have been cleared lfs3_fs_stat(&lfs3, &fsinfo) => 0; @@ -6444,13 +6444,13 @@ code = ''' lfs3_unmount(&lfs3) => 0; ''' -[cases.test_trvs_compact_mtree] +[cases.test_trvs_compactmeta_mtree] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.SIZE = 'FILE_CACHE_SIZE/2' -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.COMPACTSET = 'range(0x8)' code = ''' lfs3_t lfs3; @@ -6517,10 +6517,10 @@ code = ''' i += 1; } - // write to each file until mdir >gc_compact_thresh full + // write to each file until mdir >gc_compactmeta_thresh full if (COMPACTSET & 0x1) { // hack, don't use the internals like this - while ((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file1) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf1[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -6532,7 +6532,7 @@ code = ''' if (COMPACTSET & 0x2) { // hack, don't use the internals like this - while ((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file2) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf2[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -6544,7 +6544,7 @@ code = ''' if (COMPACTSET & 0x4) { // hack, don't use the internals like this - while ((file3.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file3.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file3) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf3[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -6560,7 +6560,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -6569,7 +6569,7 @@ code = ''' lfs3_trv_t trv; lfs3_trv_open(&lfs3, &trv, LFS3_T_RDWR - | LFS3_T_COMPACT + | LFS3_T_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_T_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -6608,16 +6608,16 @@ code = ''' if (COMPACTSET) { // mdirs should have been compacted - assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file3.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file3.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // but because we mutated, we're still marked as uncompacted lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -6635,9 +6635,9 @@ code = ''' lfs3_trv_close(&lfs3, &trv) => 0; // mdirs should have been compacted - assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file3.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file3.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // uncompacted flag should have been cleared lfs3_fs_stat(&lfs3, &fsinfo) => 0; @@ -6683,13 +6683,13 @@ code = ''' lfs3_unmount(&lfs3) => 0; ''' -[cases.test_trvs_compact_mtree_split] +[cases.test_trvs_compactmeta_mtree_split] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] defines.SIZE = 'FILE_CACHE_SIZE/2' -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' in = 'lfs3.c' code = ''' lfs3_t lfs3; @@ -6777,7 +6777,7 @@ code = ''' &file2.b.h.mdir, -1, -1, NULL); assert(estimate >= 0); - if ((file2.b.h.mdir.r.eoff & 0x7fffffff) > GC_COMPACT_THRESH + if ((file2.b.h.mdir.r.eoff & 0x7fffffff) > GC_COMPACTMETA_THRESH && estimate > BLOCK_SIZE/2) { break; } @@ -6797,7 +6797,7 @@ code = ''' assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -6806,7 +6806,7 @@ code = ''' lfs3_trv_t trv; lfs3_trv_open(&lfs3, &trv, LFS3_T_RDWR - | LFS3_T_COMPACT + | LFS3_T_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_T_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -6849,17 +6849,17 @@ code = ''' lfs3_trv_read(&lfs3, &trv, &tinfo) => LFS3_ERR_NOENT; // mdirs should have been compacted - assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file3.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file4.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file3.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file4.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // but because we mutated, we're still marked as uncompacted lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -6876,10 +6876,10 @@ code = ''' lfs3_trv_close(&lfs3, &trv) => 0; // mdirs should have been compacted - assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file3.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file4.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file3.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file4.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // uncompacted flag should have been cleared lfs3_fs_stat(&lfs3, &fsinfo) => 0; @@ -7007,7 +7007,7 @@ code = ''' | ((GBMAP && ORPHANS >= 100) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -7067,7 +7067,7 @@ code = ''' | ((GBMAP && ORPHANS >= 100) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0) | ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0) @@ -7144,7 +7144,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -7225,7 +7225,7 @@ code = ''' | ((GBMAP && ORPHANS >= 100) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0) | ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0) @@ -7329,7 +7329,7 @@ code = ''' ((ORPHANS > 0) ? LFS3_I_MKCONSISTENT : 0) | LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -7401,7 +7401,7 @@ code = ''' assert(fsinfo.flags == ( ((!REPOPLOOKAHEAD || ORPHANS > 0) ? LFS3_I_REPOPLOOKAHEAD : 0) | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0) | ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0) @@ -7505,7 +7505,7 @@ code = ''' ((ORPHANS > 0) ? LFS3_I_MKCONSISTENT : 0) | LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -7577,7 +7577,7 @@ code = ''' assert(fsinfo.flags == ( ((!REPOPLOOKAHEAD || ORPHANS > 0) ? LFS3_I_REPOPLOOKAHEAD : 0) | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0) | ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0) @@ -7682,7 +7682,7 @@ code = ''' ((ORPHANS > 0) ? LFS3_I_MKCONSISTENT : 0) | LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -7762,7 +7762,7 @@ code = ''' assert(fsinfo.flags == ( ((!REPOPLOOKAHEAD || ORPHANS > 0) ? LFS3_I_REPOPLOOKAHEAD : 0) | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0) | ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0) @@ -7867,7 +7867,7 @@ code = ''' ((ORPHANS > 0) ? LFS3_I_MKCONSISTENT : 0) | LFS3_I_REPOPLOOKAHEAD | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -7947,7 +7947,7 @@ code = ''' assert(fsinfo.flags == ( ((!REPOPLOOKAHEAD || ORPHANS > 0) ? LFS3_I_REPOPLOOKAHEAD : 0) | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA // note ckdata implies ckmeta | (((!CKMETA && !CKDATA) || ORPHANS > 0) ? LFS3_I_CKMETA : 0) | ((!CKDATA || ORPHANS > 0) ? LFS3_I_CKDATA : 0) @@ -7980,7 +7980,7 @@ code = ''' lfs3_unmount(&lfs3) => 0; ''' -[cases.test_trvs_mkconsistent_compact] +[cases.test_trvs_mkconsistent_compactmeta] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] @@ -7988,8 +7988,8 @@ defines.SIZE = 'FILE_CACHE_SIZE/2' # <=2 => grm-able # >2 => requires orphans defines.ORPHANS = [0, 1, 2, 3, 100] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' code = ''' lfs3_t lfs3; lfs3_format(&lfs3, @@ -8042,10 +8042,10 @@ code = ''' lfs3_file_close(&lfs3, &orphans[i]) => 0; } - // write to our mdirs until >gc_compact_thresh full + // write to our mdirs until >gc_compactmeta_thresh full // // hack, don't use the internals like this - while ((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file1) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf1[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -8054,7 +8054,7 @@ code = ''' lfs3_file_sync(&lfs3, &file1) => 0; } - while ((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file2) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf2[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -8072,7 +8072,7 @@ code = ''' | ((GBMAP && ORPHANS >= 100) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -8082,7 +8082,7 @@ code = ''' lfs3_trv_open(&lfs3, &trv, LFS3_T_RDWR | LFS3_T_MKCONSISTENT - | LFS3_T_COMPACT + | LFS3_T_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_T_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -8126,8 +8126,8 @@ code = ''' assert(file2.b.h.mdir.r.weight <= 3); // mdirs should have been compacted - assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // we should be marked as consistent, but because we mutated, we're // still marked as uncompacted @@ -8137,7 +8137,7 @@ code = ''' | ((GBMAP && ORPHANS >= 100) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -8154,8 +8154,8 @@ code = ''' lfs3_trv_close(&lfs3, &trv) => 0; // mdirs should have been compacted - assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // uncompacted flag should have been cleared lfs3_fs_stat(&lfs3, &fsinfo) => 0; @@ -8196,7 +8196,7 @@ code = ''' lfs3_unmount(&lfs3) => 0; ''' -[cases.test_trvs_mkconsistent_compact_conflict] +[cases.test_trvs_mkconsistent_compactmeta_conflict] defines.REPOPLOOKAHEAD = [false, true] defines.CKMETA = [false, true] defines.CKDATA = [false, true] @@ -8204,8 +8204,8 @@ defines.SIZE = 'FILE_CACHE_SIZE/2' # <=2 => grm-able # >2 => requires orphans defines.ORPHANS = [0, 1, 2, 3, 100] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' code = ''' lfs3_t lfs3; lfs3_format(&lfs3, @@ -8237,10 +8237,10 @@ code = ''' lfs3_file_write(&lfs3, &file2, wbuf2, SIZE) => SIZE; lfs3_file_sync(&lfs3, &file2) => 0; - // write to our mdirs until >gc_compact_thresh full + // write to our mdirs until >gc_compactmeta_thresh full // // hack, don't use the internals like this - while ((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file1) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf1[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -8249,7 +8249,7 @@ code = ''' lfs3_file_sync(&lfs3, &file1) => 0; } - while ((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH) { + while ((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH) { lfs3_file_rewind(&lfs3, &file2) => 0; for (lfs3_size_t j = 0; j < SIZE; j++) { wbuf2[j] = 'a' + (TEST_PRNG(&prng) % 26); @@ -8263,7 +8263,7 @@ code = ''' lfs3_fs_stat(&lfs3, &fsinfo) => 0; assert(fsinfo.flags == ( LFS3_I_REPOPLOOKAHEAD - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -8273,7 +8273,7 @@ code = ''' lfs3_trv_open(&lfs3, &trv, LFS3_T_RDWR | LFS3_T_MKCONSISTENT - | LFS3_T_COMPACT + | LFS3_T_COMPACTMETA | ((REPOPLOOKAHEAD) ? LFS3_T_REPOPLOOKAHEAD : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -8338,8 +8338,8 @@ code = ''' } // mdirs should have been compacted - assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); - assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACT_THRESH); + assert((file1.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); + assert((file2.b.h.mdir.r.eoff & 0x7fffffff) <= GC_COMPACTMETA_THRESH); // if we introduced actual orphans, we _must_ be marked as inconsistent lfs3_fs_stat(&lfs3, &fsinfo) => 0; @@ -8349,7 +8349,7 @@ code = ''' | ((GBMAP && ORPHANS >= 100) ? LFS3_IFDEF_GBMAP(LFS3_I_REPOPGBMAP, -1) : 0) - | LFS3_I_COMPACT + | LFS3_I_COMPACTMETA | LFS3_I_CKMETA | LFS3_I_CKDATA | ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0))); @@ -8397,11 +8397,11 @@ defines.STEPS = [1, 2, 4, 8, 16, 32, 64, 128] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [true] defines.CKDATA = [true] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# 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' code = ''' @@ -8422,7 +8422,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -8516,11 +8516,11 @@ defines.STEPS = [1, 2, 4, 8, 16, 32, 64, 128] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [true] defines.CKDATA = [true] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.N = [1, 2, 4, 8, 16, 32, 64, 128, 256] defines.OPS = '2*N' defines.SEED = 42 @@ -8548,7 +8548,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -8706,11 +8706,11 @@ defines.STEPS = [1, 2, 4, 8, 16, 32, 64, 128] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [true] defines.CKDATA = [true] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.SIZE = [ '0', @@ -8743,7 +8743,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -8821,11 +8821,11 @@ defines.STEPS = [1, 2, 4, 8, 16, 32, 64, 128] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [true] defines.CKDATA = [true] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' defines.SIZE = [ @@ -8866,7 +8866,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -9075,11 +9075,11 @@ defines.STEPS = [1, 2, 4, 8, 16, 32, 64, 128] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [true] defines.CKDATA = [true] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.OPS = 20 defines.SIZE = [ 'FILE_CACHE_SIZE/2', @@ -9150,7 +9150,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -9247,11 +9247,11 @@ defines.STEPS = [1, 2, 4, 8, 16, 32, 64, 128] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [true] defines.CKDATA = [true] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' defines.SIZE = [ @@ -9303,7 +9303,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0; @@ -9708,11 +9708,11 @@ defines.STEPS = [1, 2, 4, 8, 16, 32, 64, 128] defines.MKCONSISTENT = [false, true] defines.REPOPLOOKAHEAD = [false, true] defines.REPOPGBMAP = [false, true] -defines.COMPACT = [false, true] +defines.COMPACTMETA = [false, true] defines.CKMETA = [true] defines.CKDATA = [true] -# set compact thresh to minimum -defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2' +# set compactmeta thresh to minimum +defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2' defines.N = [1, 2, 4, 8, 16, 32, 64] defines.OPS = '2*N' defines.SIZE = [ @@ -9765,7 +9765,7 @@ code = ''' | ((REPOPGBMAP) ? LFS3_IFDEF_GBMAP(LFS3_T_REPOPGBMAP, -1) : 0) - | ((COMPACT) ? LFS3_T_COMPACT : 0) + | ((COMPACTMETA) ? LFS3_T_COMPACTMETA : 0) | ((CKMETA) ? LFS3_T_CKMETA : 0) | ((CKDATA) ? LFS3_T_CKDATA : 0)) => 0;