Skip to content

Commit 8233ac9

Browse files
committed
Renamed RELOOKAHEAD -> LOOKAHEAD, REGBMAP -> LOOKGBMAP
Yeah, after using these for a bit, the RE* names were not great. Trying LOOK* now, as an alternative that hopefully still implies the similar behavior without needing an additional prefix for LOOKAHEAD: - LFS3_*_RELOOKAHEAD -> LFS3_*_LOOKAHEAD - LFS3_*_REGBMAP -> LFS3_*_LOOKGBMAP - cfg.regbmap_thresh -> cfg.lookgbmap_thresh - cfg.gc_relookahead_thresh -> cfg.gc_lookahead_thresh - cfg.gc_regbmap_thresh -> cfg.gc_lookgbmap_thresh
1 parent b6130da commit 8233ac9

File tree

8 files changed

+589
-584
lines changed

8 files changed

+589
-584
lines changed

lfs3.c

Lines changed: 78 additions & 78 deletions
Large diffs are not rendered by default.

lfs3.h

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -201,11 +201,12 @@ enum lfs3_type {
201201
0x00000800 // Make the filesystem consistent
202202
#endif
203203
#ifndef LFS3_RDONLY
204-
#define LFS3_F_RELOOKAHEAD \
204+
#define LFS3_F_LOOKAHEAD \
205205
0x00001000 // Repopulate lookahead buffer
206206
#endif
207207
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
208-
#define LFS3_F_REGBMAP 0x00002000 // Repopulate the gbmap
208+
#define LFS3_F_LOOKGBMAP \
209+
0x00002000 // Repopulate the gbmap
209210
#endif
210211
#ifndef LFS3_RDONLY
211212
#define LFS3_F_COMPACTMETA \
@@ -252,11 +253,12 @@ enum lfs3_type {
252253
0x00000800 // Make the filesystem consistent
253254
#endif
254255
#ifndef LFS3_RDONLY
255-
#define LFS3_M_RELOOKAHEAD \
256+
#define LFS3_M_LOOKAHEAD \
256257
0x00001000 // Repopulate lookahead buffer
257258
#endif
258259
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
259-
#define LFS3_M_REGBMAP 0x00002000 // Repopulate the gbmap
260+
#define LFS3_M_LOOKGBMAP \
261+
0x00002000 // Repopulate the gbmap
260262
#endif
261263
#ifndef LFS3_RDONLY
262264
#define LFS3_M_COMPACTMETA \
@@ -298,11 +300,12 @@ enum lfs3_type {
298300
0x00000800 // Filesystem needs mkconsistent to write
299301
#endif
300302
#ifndef LFS3_RDONLY
301-
#define LFS3_I_RELOOKAHEAD \
303+
#define LFS3_I_LOOKAHEAD \
302304
0x00001000 // Lookahead buffer is not full
303305
#endif
304306
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
305-
#define LFS3_I_REGBMAP 0x00002000 // The gbmap is not full
307+
#define LFS3_I_LOOKGBMAP \
308+
0x00002000 // The gbmap is not full
306309
#endif
307310
#ifndef LFS3_RDONLY
308311
#define LFS3_I_COMPACTMETA \
@@ -333,11 +336,12 @@ enum lfs3_btype {
333336
0x00000800 // Make the filesystem consistent
334337
#endif
335338
#ifndef LFS3_RDONLY
336-
#define LFS3_T_RELOOKAHEAD \
339+
#define LFS3_T_LOOKAHEAD \
337340
0x00001000 // Repopulate lookahead buffer
338341
#endif
339342
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
340-
#define LFS3_T_REGBMAP 0x00002000 // Repopulate the gbmap
343+
#define LFS3_T_LOOKGBMAP \
344+
0x00002000 // Repopulate the gbmap
341345
#endif
342346
#ifndef LFS3_RDONLY
343347
#define LFS3_T_COMPACTMETA \
@@ -361,11 +365,12 @@ enum lfs3_btype {
361365
0x00000800 // Make the filesystem consistent
362366
#endif
363367
#ifndef LFS3_RDONLY
364-
#define LFS3_GC_RELOOKAHEAD \
368+
#define LFS3_GC_LOOKAHEAD \
365369
0x00001000 // Repopulate lookahead buffer
366370
#endif
367371
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
368-
#define LFS3_GC_REGBMAP 0x00002000 // Repopulate the gbmap
372+
#define LFS3_GC_LOOKGBMAP \
373+
0x00002000 // Repopulate the gbmap
369374
#endif
370375
#ifndef LFS3_RDONLY
371376
#define LFS3_GC_COMPACTMETA \
@@ -377,9 +382,9 @@ enum lfs3_btype {
377382
// an alias for all possible GC work
378383
#define LFS3_GC_ALL ( \
379384
LFS3_IFDEF_RDONLY(0, LFS3_GC_MKCONSISTENT) \
380-
| LFS3_IFDEF_RDONLY(0, LFS3_GC_RELOOKAHEAD) \
385+
| LFS3_IFDEF_RDONLY(0, LFS3_GC_LOOKAHEAD) \
381386
| LFS3_IFDEF_RDONLY(0, \
382-
LFS3_IFDEF_GBMAP(LFS3_GC_REGBMAP, 0)) \
387+
LFS3_IFDEF_GBMAP(LFS3_GC_LOOKGBMAP, 0)) \
383388
| LFS3_IFDEF_RDONLY(0, LFS3_GC_COMPACTMETA) \
384389
| LFS3_GC_CKMETA \
385390
| LFS3_GC_CKDATA)
@@ -513,7 +518,7 @@ struct lfs3_cfg {
513518
// any value >= 8*lookahead_size repopulates the lookahead buffer
514519
// after any block allocation.
515520
#ifndef LFS3_RDONLY
516-
lfs3_block_t gc_relookahead_thresh;
521+
lfs3_block_t gc_lookahead_thresh;
517522
#endif
518523

519524
// Threshold for repopulating the gbmap during gc. This can be set
@@ -522,13 +527,13 @@ struct lfs3_cfg {
522527
//
523528
// Note this only affects explicit gc operations. During normal
524529
// operations gbmap repopulations are controlled by
525-
// regbmap_thresh.
530+
// lookgbmap_thresh.
526531
//
527-
// Any value <= regbmap_thresh repopulates the gbmap when below
528-
// regbmap_thresh, while -1 or any value >= block_count
532+
// Any value <= lookgbmap_thresh repopulates the gbmap when below
533+
// lookgbmap_thresh, while -1 or any value >= block_count
529534
// repopulates the lookahead buffer after any block allocation.
530535
#if !defined(LFS3_RDONLY) && defined(LFS3_GBMAP)
531-
lfs3_block_t gc_regbmap_thresh;
536+
lfs3_block_t gc_lookgbmap_thresh;
532537
#endif
533538

534539
// Threshold for metadata compaction during gc in bytes.
@@ -624,7 +629,7 @@ struct lfs3_cfg {
624629
// 0 only repopulates the gbmap when empty, minimizing gbmap
625630
// repops at the risk of large latency spikes.
626631
#ifdef LFS3_GBMAP
627-
lfs3_block_t regbmap_thresh;
632+
lfs3_block_t lookgbmap_thresh;
628633
#endif
629634
};
630635

@@ -898,7 +903,7 @@ typedef struct lfs3_mgc {
898903
lfs3_mtrv_t t;
899904

900905
#ifdef LFS3_GBMAP
901-
// repopulate gbmap when traversing with regbmap
906+
// repopulate gbmap when traversing with lookgbmap
902907
lfs3_btree_t gbmap_;
903908
#endif
904909
} lfs3_mgc_t;

runners/bench_runner.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size);
116116
BENCH_DEFINE(LOOKAHEAD_SIZE, 16 ) \
117117
BENCH_DEFINE(GC_FLAGS, LFS3_GC_ALL ) \
118118
BENCH_DEFINE(GC_STEPS, 0 ) \
119-
BENCH_DEFINE(GC_RELOOKAHEAD_THRESH, -1 ) \
120-
BENCH_DEFINE(GC_REGBMAP_THRESH, -1 ) \
119+
BENCH_DEFINE(GC_LOOKAHEAD_THRESH, -1 ) \
120+
BENCH_DEFINE(GC_LOOKGBMAP_THRESH, -1 ) \
121121
BENCH_DEFINE(GC_COMPACTMETA_THRESH, 0 ) \
122122
BENCH_DEFINE(SHRUB_SIZE, BLOCK_SIZE/4 ) \
123123
BENCH_DEFINE(FRAGMENT_SIZE, LFS3_MIN(BLOCK_SIZE/8, 512) ) \
124124
BENCH_DEFINE(CRYSTAL_THRESH, BLOCK_SIZE/8 ) \
125-
BENCH_DEFINE(REGBMAP_THRESH, BLOCK_COUNT/4 ) \
125+
BENCH_DEFINE(LOOKGBMAP_THRESH, BLOCK_COUNT/4 ) \
126126
BENCH_DEFINE(ERASE_VALUE, 0xff ) \
127127
BENCH_DEFINE(ERASE_CYCLES, 0 ) \
128128
BENCH_DEFINE(BADBLOCK_BEHAVIOR, LFS3_EMUBD_BADBLOCK_PROGERROR ) \
@@ -149,16 +149,16 @@ void bench_permutation(size_t i, uint32_t *buffer, size_t size);
149149
.lookahead_size = LOOKAHEAD_SIZE, \
150150
BENCH_GBMAP_CFG \
151151
BENCH_GC_CFG \
152-
.gc_relookahead_thresh = GC_RELOOKAHEAD_THRESH, \
152+
.gc_lookahead_thresh = GC_LOOKAHEAD_THRESH, \
153153
.gc_compactmeta_thresh = GC_COMPACTMETA_THRESH, \
154154
.shrub_size = SHRUB_SIZE, \
155155
.fragment_size = FRAGMENT_SIZE, \
156156
.crystal_thresh = CRYSTAL_THRESH,
157157

158158
#ifdef LFS3_GBMAP
159159
#define BENCH_GBMAP_CFG \
160-
.gc_regbmap_thresh = GC_REGBMAP_THRESH, \
161-
.regbmap_thresh = REGBMAP_THRESH,
160+
.gc_lookgbmap_thresh = GC_LOOKGBMAP_THRESH, \
161+
.lookgbmap_thresh = LOOKGBMAP_THRESH,
162162
#else
163163
#define BENCH_GBMAP_CFG
164164
#endif

runners/test_runner.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,13 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size);
107107
TEST_DEFINE(LOOKAHEAD_SIZE, 16 ) \
108108
TEST_DEFINE(GC_FLAGS, LFS3_GC_ALL ) \
109109
TEST_DEFINE(GC_STEPS, 0 ) \
110-
TEST_DEFINE(GC_RELOOKAHEAD_THRESH, -1 ) \
111-
TEST_DEFINE(GC_REGBMAP_THRESH, -1 ) \
110+
TEST_DEFINE(GC_LOOKAHEAD_THRESH, -1 ) \
111+
TEST_DEFINE(GC_LOOKGBMAP_THRESH, -1 ) \
112112
TEST_DEFINE(GC_COMPACTMETA_THRESH, 0 ) \
113113
TEST_DEFINE(SHRUB_SIZE, BLOCK_SIZE/4 ) \
114114
TEST_DEFINE(FRAGMENT_SIZE, LFS3_MIN(BLOCK_SIZE/8, 512) ) \
115115
TEST_DEFINE(CRYSTAL_THRESH, BLOCK_SIZE/8 ) \
116-
TEST_DEFINE(REGBMAP_THRESH, BLOCK_COUNT/4 ) \
116+
TEST_DEFINE(LOOKGBMAP_THRESH, BLOCK_COUNT/4 ) \
117117
TEST_DEFINE(ERASE_VALUE, 0xff ) \
118118
TEST_DEFINE(ERASE_CYCLES, 0 ) \
119119
TEST_DEFINE(BADBLOCK_BEHAVIOR, LFS3_EMUBD_BADBLOCK_PROGERROR ) \
@@ -140,16 +140,16 @@ void test_permutation(size_t i, uint32_t *buffer, size_t size);
140140
.lookahead_size = LOOKAHEAD_SIZE, \
141141
TEST_GBMAP_CFG \
142142
TEST_GC_CFG \
143-
.gc_relookahead_thresh = GC_RELOOKAHEAD_THRESH, \
143+
.gc_lookahead_thresh = GC_LOOKAHEAD_THRESH, \
144144
.gc_compactmeta_thresh = GC_COMPACTMETA_THRESH, \
145145
.shrub_size = SHRUB_SIZE, \
146146
.fragment_size = FRAGMENT_SIZE, \
147147
.crystal_thresh = CRYSTAL_THRESH,
148148

149149
#ifdef LFS3_GBMAP
150150
#define TEST_GBMAP_CFG \
151-
.gc_regbmap_thresh = GC_REGBMAP_THRESH, \
152-
.regbmap_thresh = REGBMAP_THRESH,
151+
.gc_lookgbmap_thresh = GC_LOOKGBMAP_THRESH, \
152+
.lookgbmap_thresh = LOOKGBMAP_THRESH,
153153
#else
154154
#define TEST_GBMAP_CFG
155155
#endif

scripts/dbgflags.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@
8181
F_CKDATACKSUMS = 0x01000000 # y- Check data checksums on reads
8282

8383
F_MKCONSISTENT = 0x00000800 # y- Make the filesystem consistent
84-
F_RELOOKAHEAD = 0x00001000 # y- Repopulate lookahead buffer
85-
F_REGBMAP = 0x00002000 # y- Repopulate the gbmap
84+
F_LOOKAHEAD = 0x00001000 # y- Repopulate lookahead buffer
85+
F_LOOKGBMAP = 0x00002000 # y- Repopulate the gbmap
8686
F_COMPACTMETA = 0x00008000 # y- Compact metadata logs
8787
F_CKMETA = 0x00010000 # y- Check metadata checksums
8888
F_CKDATA = 0x00020000 # y- Check metadata + data checksums
@@ -101,16 +101,16 @@
101101
M_CKDATACKSUMS = 0x01000000 # y- Check data checksums on reads
102102

103103
M_MKCONSISTENT = 0x00000800 # y- Make the filesystem consistent
104-
M_RELOOKAHEAD = 0x00001000 # y- Repopulate lookahead buffer
105-
M_REGBMAP = 0x00002000 # y- Repopulate the gbmap
104+
M_LOOKAHEAD = 0x00001000 # y- Repopulate lookahead buffer
105+
M_LOOKGBMAP = 0x00002000 # y- Repopulate the gbmap
106106
M_COMPACTMETA = 0x00008000 # y- Compact metadata logs
107107
M_CKMETA = 0x00010000 # y- Check metadata checksums
108108
M_CKDATA = 0x00020000 # y- Check metadata + data checksums
109109

110110
# GC flags
111111
GC_MKCONSISTENT = 0x00000800 # -- Make the filesystem consistent
112-
GC_RELOOKAHEAD = 0x00001000 # -- Repopulate lookahead buffer
113-
GC_REGBMAP = 0x00002000 # -- Repopulate the gbmap
112+
GC_LOOKAHEAD = 0x00001000 # -- Repopulate lookahead buffer
113+
GC_LOOKGBMAP = 0x00002000 # -- Repopulate the gbmap
114114
GC_COMPACTMETA = 0x00008000 # -- Compact metadata logs
115115
GC_CKMETA = 0x00010000 # -- Check metadata checksums
116116
GC_CKDATA = 0x00020000 # -- Check metadata + data checksums
@@ -129,8 +129,8 @@
129129
I_CKDATACKSUMS = 0x01000000 # -- Mounted with LFS3_M_CKDATACKSUMS
130130

131131
I_MKCONSISTENT = 0x00000800 # -- Filesystem needs mkconsistent to write
132-
I_RELOOKAHEAD = 0x00001000 # -- Lookahead buffer is not full
133-
I_REGBMAP = 0x00002000 # -- The gbmap is not full
132+
I_LOOKAHEAD = 0x00001000 # -- Lookahead buffer is not full
133+
I_LOOKGBMAP = 0x00002000 # -- The gbmap is not full
134134
I_COMPACTMETA = 0x00008000 # -- Filesystem may have uncompacted metadata
135135
I_CKMETA = 0x00010000 # -- Metadata checksums not checked recently
136136
I_CKDATA = 0x00020000 # -- Data checksums not checked recently
@@ -142,8 +142,8 @@
142142
T_MTREEONLY = 0x00000002 # -- Only traverse the mtree
143143
T_EXCL = 0x00000008 # -- Error if filesystem modified
144144
T_MKCONSISTENT = 0x00000800 # -- Make the filesystem consistent
145-
T_RELOOKAHEAD = 0x00001000 # -- Repopulate lookahead buffer
146-
T_REGBMAP = 0x00002000 # -- Repopulate the gbmap
145+
T_LOOKAHEAD = 0x00001000 # -- Repopulate lookahead buffer
146+
T_LOOKGBMAP = 0x00002000 # -- Repopulate the gbmap
147147
T_COMPACTMETA = 0x00008000 # -- Compact metadata logs
148148
T_CKMETA = 0x00010000 # -- Check metadata checksums
149149
T_CKDATA = 0x00020000 # -- Check metadata + data checksums

0 commit comments

Comments
 (0)