Renamed LFS3_T_COMPACTMETA -> LFS3_T_COMPACT (and gc_compact_thresh)

This effectively reverts 1f824a0:

- LFS3_T_COMPACTMETA -> LFS3_T_COMPACT
- gc_compactmeta_thresh -> gc_compact_thresh

And friends.

After using LFS3_T_COMPACTMETA for a bit, I think it just adds noise
without much value. Especially when next to LFS3_T_LOOKAHEAD,
LFS3_GC_PREERASE, LFS3_M_SYNC, etc.

It's interesting that we already have some very distinct verbs for this
sort of thing based on data type (compact => metadata, garbage-collect
=> disk, compress => data).
This commit is contained in:
Christopher Haster
2025-12-05 01:05:35 -06:00
parent 347c7b7290
commit 7a57b1e2bd
10 changed files with 362 additions and 368 deletions
+10 -10
View File
@@ -463,11 +463,11 @@ code = '''
[cases.test_kv_many]
defines.N = [40, 400]
defines.SIZE = 4
defines.COMPACTMETA = [false, true]
defines.GC_FLAGS = 'LFS3_GC_COMPACTMETA'
defines.COMPACT = [false, true]
defines.GC_FLAGS = 'LFS3_GC_COMPACT'
defines.GC_STEPS = -1
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
if = 'LFS3_IFDEF_GC(true, !COMPACTMETA)'
defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2'
if = 'LFS3_IFDEF_GC(true, !COMPACT)'
code = '''
lfs3_t lfs3;
lfs3_format(&lfs3, LFS3_F_RDWR, CFG) => 0;
@@ -489,7 +489,7 @@ code = '''
// try compacting?
#ifdef LFS3_GC
if (COMPACTMETA) {
if (COMPACT) {
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.COMPACTMETA = [false, true]
defines.GC_FLAGS = 'LFS3_GC_COMPACTMETA'
defines.COMPACT = [false, true]
defines.GC_FLAGS = 'LFS3_GC_COMPACT'
defines.GC_STEPS = -1
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
if = 'LFS3_IFDEF_GC(true, !COMPACTMETA)'
defines.GC_COMPACT_THRESH = 'BLOCK_SIZE/2'
if = 'LFS3_IFDEF_GC(true, !COMPACT)'
code = '''
lfs3_t lfs3;
lfs3_format(&lfs3, LFS3_F_RDWR, CFG) => 0;
@@ -664,7 +664,7 @@ code = '''
// try compacting?
#ifdef LFS3_GC
if (COMPACTMETA) {
if (COMPACT) {
lfs3_fs_gc(&lfs3) => 0;
}
#endif