Added LFSR_WCOMPAT_GCKSUM wcompat flag
The gcksum isn't actually implemented yet, I mostly just wanted to
measure this code cost separately:
code stack ctx
before: 37768 2608 620
after: 37796 (+0.1%) 2608 (+0.0%) 620 (+0.0%)
I may be procrastinating a little bit...
This commit is contained in:
@@ -13383,7 +13383,7 @@ static int lfs_deinit(lfs_t *lfs) {
|
||||
//
|
||||
#define LFSR_RCOMPAT_NONSTANDARD 0x00000001 // Non-standard filesystem format
|
||||
#define LFSR_RCOMPAT_WRONLY 0x00000002 // Reading is disallowed
|
||||
#define LFSR_RCOMPAT_GRM 0x00000004 // May use a global-remove
|
||||
#define LFSR_RCOMPAT_GRM 0x00000004 // Global-remove in use
|
||||
#define LFSR_RCOMPAT_MMOSS 0x00000010 // May use an inlined mdir
|
||||
#define LFSR_RCOMPAT_MSPROUT 0x00000020 // May use an mdir pointer
|
||||
#define LFSR_RCOMPAT_MSHRUB 0x00000040 // May use an inlined mtree
|
||||
@@ -13407,10 +13407,12 @@ static int lfs_deinit(lfs_t *lfs) {
|
||||
|
||||
#define LFSR_WCOMPAT_NONSTANDARD 0x00000001 // Non-standard filesystem format
|
||||
#define LFSR_WCOMPAT_RDONLY 0x00000002 // Writing is disallowed
|
||||
#define LFSR_WCOMPAT_GCKSUM 0x00000004 // Global-checksum in use
|
||||
// internal
|
||||
#define LFSR_wcompat_OVERFLOW 0x80000000 // Can't represent all flags
|
||||
|
||||
#define LFSR_WCOMPAT_COMPAT 0
|
||||
#define LFSR_WCOMPAT_COMPAT \
|
||||
(LFSR_WCOMPAT_GCKSUM)
|
||||
|
||||
#define LFSR_OCOMPAT_NONSTANDARD 0x00000001 // Non-standard filesystem format
|
||||
// internal
|
||||
@@ -14000,6 +14002,7 @@ static int lfsr_formatinited(lfs_t *lfs) {
|
||||
// - any format-time configuration
|
||||
// - the root's bookmark tag, which reserves did = 0 for the root
|
||||
uint8_t rcompat_buf[LFSR_LE32_DSIZE];
|
||||
uint8_t wcompat_buf[LFSR_LE32_DSIZE];
|
||||
uint8_t geometry_buf[LFSR_GEOMETRY_DSIZE];
|
||||
uint8_t name_limit_buf[LFSR_LLEB128_DSIZE];
|
||||
uint8_t file_limit_buf[LFSR_LEB128_DSIZE];
|
||||
@@ -14016,6 +14019,9 @@ static int lfsr_formatinited(lfs_t *lfs) {
|
||||
LFSR_RAT(
|
||||
LFSR_TAG_RCOMPAT, 0,
|
||||
LFSR_DATA_LE32(LFSR_RCOMPAT_COMPAT, rcompat_buf)),
|
||||
LFSR_RAT(
|
||||
LFSR_TAG_WCOMPAT, 0,
|
||||
LFSR_DATA_LE32(LFSR_WCOMPAT_COMPAT, wcompat_buf)),
|
||||
LFSR_RAT(
|
||||
LFSR_TAG_GEOMETRY, 0,
|
||||
LFSR_DATA_GEOMETRY(
|
||||
|
||||
+3
-1
@@ -152,7 +152,7 @@ FLAGS = [
|
||||
('RCOMPAT', 'WRONLY',
|
||||
0x00000002, "Reading is disallowed" ),
|
||||
('RCOMPAT', 'GRM',
|
||||
0x00000004, "May use a global-remove" ),
|
||||
0x00000004, "Global-remove in use" ),
|
||||
('RCOMPAT', 'MMOSS',
|
||||
0x00000010, "May use an inlined mdir" ),
|
||||
('RCOMPAT', 'MSPROUT',
|
||||
@@ -177,6 +177,8 @@ FLAGS = [
|
||||
0x00000001, "Non-standard filesystem format" ),
|
||||
('WCOMPAT', 'RDONLY',
|
||||
0x00000002, "Writing is disallowed" ),
|
||||
('WCOMPAT', 'GCKSUM',
|
||||
0x00000004, "Global-checksum in use" ),
|
||||
('wcompat', 'OVERFLOW',
|
||||
0x80000000, "Can't represent all flags" ),
|
||||
|
||||
|
||||
Reference in New Issue
Block a user