Mention that shrinking is unlikely to work

This commit is contained in:
Sosthène Guédon
2025-05-06 10:59:32 +02:00
parent 9b8f802b43
commit 7782d3dfa3
4 changed files with 26 additions and 3 deletions

6
lfs.h
View File

@@ -766,11 +766,11 @@ int lfs_fs_gc(lfs_t *lfs);
// Grows the filesystem to a new size, updating the superblock with the new
// block count.
//
// if LFS_SHRINKIFCHEAP is defined, this function will also accept
// If LFS_SHRINKIFCHEAP is defined, this function will also accept
// block_counts smaller than the current configuration, after checking
// that none of the blocks that are being removed are in use.
//
// Note: This is irreversible.
// Note that littlefs's pseudorandom block allocation means that
// this is very unlikely to work in the general case.
//
// Returns a negative error code on failure.
int lfs_fs_grow(lfs_t *lfs, lfs_size_t block_count);