Shrinked on-disk directory program size

Directories still consume two full erase blocks, but now only program
the exact on-disk region to store the directory contents. This results
in a decent improvement in the amount of data written and read to the
device when doing directory operations.

Calculating the checksum of dynamically sized data is surprisingly
tricky, since the size of the data could also contain errors. For the
littlefs, we can assume the data size must fit in an erase block.
If the data size is invalid, we can just treat the block as corrupted.
This commit is contained in:
Christopher Haster
2017-06-23 20:03:44 -05:00
parent 0d66f9f991
commit 1eeb2a6811
2 changed files with 23 additions and 34 deletions

View File

@@ -61,11 +61,11 @@ lfs_size_t rsize;
uintmax_t res;
#ifndef LFS_READ_SIZE
#define LFS_READ_SIZE 64
#define LFS_READ_SIZE 16
#endif
#ifndef LFS_PROG_SIZE
#define LFS_PROG_SIZE 64
#define LFS_PROG_SIZE 16
#endif
#ifndef LFS_BLOCK_SIZE