Renamed file_cache -> fcache and gbmap_re -> regbmap
This walks back some of the attempt at strict object namespacing in struct lfs3_cfg: - cfg.file_cache_size -> cfg.fcache_size - filecfg.cache_size -> filecfg.fcache_size - filecfg.cache_buffer -> filecfg.fcache_buffer - cfg.gbmap_re_thresh -> cfg.regbmap_thresh Motivation: - cfg.regbmap_thresh now matches cfg.gc_regbmap_thresh, instead of using awkwardly different namespacing patterns. - Giving fcache a more unique name is useful for discussion. Having pcache, rcache, and then file_cache was a bit awkward. Hopefully it's also more clear that cfg.fcache_size and filecfg.fcache_size are related. - Config in struct lfs3_cfg is named a bit more consistently, well, if you ignore gc_*_* options. - Less typing. Though this gets into pretty subjective naming territory. May revert this if the new terms are uncomfortable after use.
This commit is contained in:
+50
-50
@@ -288,8 +288,8 @@ code = '''
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -407,8 +407,8 @@ code = '''
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -660,8 +660,8 @@ code = '''
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -788,8 +788,8 @@ code = '''
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1013,8 +1013,8 @@ done:;
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1112,8 +1112,8 @@ done:;
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1294,8 +1294,8 @@ done:;
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1391,8 +1391,8 @@ done:;
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1571,8 +1571,8 @@ done:;
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -1668,8 +1668,8 @@ done:;
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -2202,8 +2202,8 @@ defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = [
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -2287,8 +2287,8 @@ defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = [
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -2354,16 +2354,16 @@ code = '''
|
||||
lfs3_fs_stat(&lfs3, &fsinfo) => 0;
|
||||
assert(fsinfo.flags == (
|
||||
// ok we might've updated lookahead if write stayed in cache
|
||||
((!RELOOKAHEAD || SIZE > FILE_CACHE_SIZE || SYNC)
|
||||
((!RELOOKAHEAD || SIZE > FCACHE_SIZE || SYNC)
|
||||
? LFS3_I_RELOOKAHEAD : 0)
|
||||
| ((GBMAP && SIZE >= BLOCK_SIZE/4)
|
||||
? LFS3_IFDEF_GBMAP(LFS3_I_REGBMAP, -1)
|
||||
: 0)
|
||||
| LFS3_I_COMPACTMETA
|
||||
// and maybe ckmeta/ckdata, note ckdata implies ckmeta
|
||||
| (((!CKMETA && !CKDATA) || SIZE > FILE_CACHE_SIZE || SYNC)
|
||||
| (((!CKMETA && !CKDATA) || SIZE > FCACHE_SIZE || SYNC)
|
||||
? LFS3_I_CKMETA : 0)
|
||||
| ((!CKDATA || SIZE > FILE_CACHE_SIZE || SYNC)
|
||||
| ((!CKDATA || SIZE > FCACHE_SIZE || SYNC)
|
||||
? LFS3_I_CKDATA : 0)
|
||||
| ((GBMAP) ? LFS3_IFDEF_GBMAP(LFS3_I_GBMAP, -1) : 0)));
|
||||
|
||||
@@ -2392,7 +2392,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
defines.TRUNC = [false, true]
|
||||
code = '''
|
||||
lfs3_t lfs3;
|
||||
@@ -2708,7 +2708,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
code = '''
|
||||
lfs3_t lfs3;
|
||||
lfs3_format(&lfs3,
|
||||
@@ -3030,7 +3030,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
defines.DESYNC = [false, true]
|
||||
code = '''
|
||||
lfs3_t lfs3;
|
||||
@@ -5872,7 +5872,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
# set compactmeta thresh to minimum
|
||||
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
|
||||
code = '''
|
||||
@@ -5993,7 +5993,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
# set compactmeta thresh to minimum
|
||||
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
|
||||
# force early relocations
|
||||
@@ -6148,7 +6148,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
# set compactmeta thresh to minimum
|
||||
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
|
||||
# force early relocations
|
||||
@@ -6276,7 +6276,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
# set compactmeta thresh to minimum
|
||||
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
|
||||
in = 'lfs3.c'
|
||||
@@ -6451,7 +6451,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
# set compactmeta thresh to minimum
|
||||
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
|
||||
defines.COMPACTSET = 'range(0x8)'
|
||||
@@ -6690,7 +6690,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
# set compactmeta thresh to minimum
|
||||
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
|
||||
in = 'lfs3.c'
|
||||
@@ -6945,7 +6945,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
# <=2 => grm-able
|
||||
# >2 => requires orphans
|
||||
defines.ORPHANS = [0, 1, 2, 3, 100]
|
||||
@@ -7107,7 +7107,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
# <=2 => grm-able
|
||||
# >2 => requires orphans
|
||||
defines.ORPHANS = [0, 1, 2, 3, 100]
|
||||
@@ -7987,7 +7987,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
# <=2 => grm-able
|
||||
# >2 => requires orphans
|
||||
defines.ORPHANS = [0, 1, 2, 3, 100]
|
||||
@@ -8203,7 +8203,7 @@ code = '''
|
||||
defines.RELOOKAHEAD = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
defines.SIZE = 'FILE_CACHE_SIZE/2'
|
||||
defines.SIZE = 'FCACHE_SIZE/2'
|
||||
# <=2 => grm-able
|
||||
# >2 => requires orphans
|
||||
defines.ORPHANS = [0, 1, 2, 3, 100]
|
||||
@@ -8717,8 +8717,8 @@ defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
|
||||
defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -8833,8 +8833,8 @@ defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.OPS = '2*N'
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -9085,8 +9085,8 @@ defines.CKDATA = [true]
|
||||
defines.GC_COMPACTMETA_THRESH = 'BLOCK_SIZE/2'
|
||||
defines.OPS = 20
|
||||
defines.SIZE = [
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -9261,8 +9261,8 @@ defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.OPS = '2*N'
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
@@ -9726,8 +9726,8 @@ defines.N = [1, 2, 4, 8, 16, 32, 64]
|
||||
defines.OPS = '2*N'
|
||||
defines.SIZE = [
|
||||
'0',
|
||||
'FILE_CACHE_SIZE/2',
|
||||
'2*FILE_CACHE_SIZE',
|
||||
'FCACHE_SIZE/2',
|
||||
'2*FCACHE_SIZE',
|
||||
'BLOCK_SIZE/2',
|
||||
'BLOCK_SIZE',
|
||||
'2*BLOCK_SIZE',
|
||||
|
||||
Reference in New Issue
Block a user