Dropped LFS_F_COMPACT flags from lfsr_format
The argument for this flag is pretty brittle. Yes it's _technically_
possible to end up with a compactable filesystem during lfsr_format, but
it's pretty unlikely. And keeping LFS_F_COMPACT around means we'd always
need the lfsr_mtree_gc circuitry in lfsr_format, for such a niche
situation, that can be easily cleaned up in lfsr_mount.
So dropping for now.
No code changes, but this does mean one less feature to support:
code stack ctx
before: 37804 2608 620
after: 37804 (+0.0%) 2608 (+0.0%) 620 (+0.0%)
This commit is contained in:
@@ -14141,7 +14141,6 @@ int lfsr_format(lfs_t *lfs, uint32_t flags,
|
||||
| LFS_IFDEF_CKFETCHES(LFS_F_CKFETCHES, 0)
|
||||
| LFS_IFDEF_CKPARITY(LFS_F_CKPARITY, 0)
|
||||
| LFS_IFDEF_CKDATACKSUMS(LFS_F_CKDATACKSUMS, 0)
|
||||
| LFS_F_COMPACT
|
||||
| LFS_F_CKMETA
|
||||
| LFS_F_CKDATA)) == 0);
|
||||
// some flags don't make sense when only traversing the mtree
|
||||
@@ -14179,14 +14178,12 @@ int lfsr_format(lfs_t *lfs, uint32_t flags,
|
||||
|
||||
// run gc if requested
|
||||
if (flags & (
|
||||
LFS_F_COMPACT
|
||||
| LFS_F_CKMETA
|
||||
LFS_F_CKMETA
|
||||
| LFS_F_CKDATA)) {
|
||||
lfsr_traversal_t t;
|
||||
err = lfsr_fs_gc_(lfs, &t,
|
||||
flags & (
|
||||
LFS_F_COMPACT
|
||||
| LFS_F_CKMETA
|
||||
LFS_F_CKMETA
|
||||
| LFS_F_CKDATA),
|
||||
-1);
|
||||
if (err) {
|
||||
|
||||
@@ -173,7 +173,6 @@ enum lfs_type {
|
||||
0x08000000 // Check data checksums on reads
|
||||
#endif
|
||||
|
||||
#define LFS_F_COMPACT 0x00008000 // Compact metadata logs
|
||||
#define LFS_F_CKMETA 0x00010000 // Check metadata checksums
|
||||
#define LFS_F_CKDATA 0x00020000 // Check metadata + data checksums
|
||||
|
||||
|
||||
@@ -85,7 +85,6 @@ defines.CKPROGS = [false, true]
|
||||
defines.CKFETCHES = [false, true]
|
||||
defines.CKPARITY = [false, true]
|
||||
defines.CKDATACKSUMS = [false, true]
|
||||
defines.COMPACT = [false, true]
|
||||
defines.CKMETA = [false, true]
|
||||
defines.CKDATA = [false, true]
|
||||
if = [
|
||||
@@ -104,9 +103,8 @@ code = '''
|
||||
| ((CKDATACKSUMS)
|
||||
? LFS_IFDEF_CKDATACKSUMS(LFS_F_CKDATACKSUMS, -1)
|
||||
: 0)
|
||||
| ((COMPACT) ? LFS_M_COMPACT : 0)
|
||||
| ((CKMETA) ? LFS_M_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS_M_CKDATA : 0),
|
||||
| ((CKMETA) ? LFS_F_CKMETA : 0)
|
||||
| ((CKDATA) ? LFS_F_CKDATA : 0),
|
||||
CFG) => 0;
|
||||
|
||||
lfsr_mount(&lfs, LFS_M_RDWR, CFG) => 0;
|
||||
|
||||
Reference in New Issue
Block a user