Skip to content

v2.8

Compare
Choose a tag to compare
@geky-bot geky-bot released this 22 Sep 17:44
f77214d

This release brings in some useful community-driven features.

What's new?

  • Thanks to @BrianPugh, littlefs no longer needs the block_count when mounting an existing filesystem (#866)

    Simply set block_count=0 in your configuration, and littlefs will automatically determine the block_count based on what's on disk. This allows you to mount a filesystem of unknown size.

  • Added lfs_fs_grow which allows you to change the size of an existing filesystem, thanks to @kaetemi (#872)

    The main use case is for changing the size of a partition as storage requirements change.

    Note: littlefs does not support shrinking a filesystem, and this is unlikely to change (it's a hard problem).

  • Added lfs_fs_gc which allows you to manually run the block allocator, thanks to @opilat (#875)

    Note: littlefs currently does not persist any found free blocks to disk, though this may change in the future.

    This limits the current value of lfs_fs_gc, but it may still be useful for moving the expensive block scan out of performance sensitive code paths.

Changes

Code Stack Structs Coverage
Default 16838 B (+1.0%) 1448 B (+1.1%) 800 B (+1.5%) Lines 2357/2533 lines (+0.3%)
Readonly 6130 B (+0.1%) 448 B (+0.0%) 800 B (+1.5%) Branches 1202/1528 branches (+0.1%)
Threadsafe 17722 B (+1.2%) 1448 B (+1.1%) 808 B (+1.5%) Benchmarks
Multiversion 16898 B (+0.9%) 1448 B (+1.1%) 804 B (+1.5%) Readed 29369693876 B (+0.0%)
Migrate 18514 B (+0.8%) 1752 B (+0.9%) 804 B (+1.5%) Proged 1482874766 B (+0.0%)
Error-asserts 17498 B (+1.1%) 1440 B (+1.1%) 800 B (+1.5%) Erased 1568888832 B (+0.0%)

f91c5bd Bumped minor version to v2.8
6b33ee5 Renamed lfs_fs_findfreeblocks -> lfs_fs_gc, tweaked documentation
63e4408 Extended alloc tests to test some properties of lfs_fs_findfreeblocks
dbe4598 Added API boilerplate for lfs_fs_findfreeblocks and consistent style
d85a0fe Move lookahead buffer offset at the first free block if such block doesn't exist move it for whole lookahead size.
b637379 Update lfs_find_free_blocks to match the latest changes.
23505fa Added lfs_fs_grow for growing the filesystem to a different block_count
2c222af Tweaked lfs_fsinfo block_size/block_count fields
127d84b Added a couple mixed/unknown block_count tests
027331b Adopted erase_size/erase_count config in test block-devices/runners
9c23329 Revert of refactor lfs_scan_* out of lfs_format
23089d5 remove previous block_count detection from lfs_format
d6098bd Add block_count and block_size to fsinfo
d6c0c6a linting
5caa83f forgot to unmount lfs in test; leaking memory
7521e0a fix newly introduced missing cleanup when an invalid superblock is found.
2ebfec7 test for failure when interpretting block count when formatting without superblock
3d0bcf4 Add test_superblocks_mount_unknown_block_count
6de3fc6 fix corruption check
df238eb Add a unit test; currently hanging on final permutation.
be68122 introduce lfs->block_count. If cfg->block_count is 0, autopopulate from superblock
6dae703 remove redundant superblock check
7328527 refactor lfs_scan_for_state_updates and lfs_scan_for_superblock out of lfs_format