Added LFS_O_CKMETA/CKDATA flags
These flags just call lfsr_file_ckmeta/ckdata under the hood, but make
it very easy to check metadata/data when opening a file. As an extra
plus they implicitly close the file on failure, so might make cleanup
easier.
Of course, everything has a cost:
code stack
before: 36368 2664
after: 36424 (+0.2%) 2664 (+0.0%)
These also ruin my previous "you don't pay for what you don't call"
assertion, since runtime flags unfortunately always pull in code.
We should add a compile-time switch for these evntually.
This commit is contained in:
@@ -136,6 +136,8 @@ enum lfs_type {
|
||||
#define LFS_O_FLUSH 0x00000040 // Flush data on every write
|
||||
#define LFS_O_SYNC 0x00000080 // Sync metadata on every write
|
||||
#define LFS_O_DESYNC 0x00000100 // Do not sync or recieve file updates
|
||||
#define LFS_O_CKMETA 0x00001000 // Check metadata checksums
|
||||
#define LFS_O_CKDATA 0x00002000 // Check metadata + data checksums
|
||||
|
||||
// internally used flags
|
||||
#define LFS_F_TYPE 0xff000000 // The file's type
|
||||
|
||||
Reference in New Issue
Block a user