forked from Imagelibrary/littlefs
Apply review comments
This commit is contained in:
5
lfs.c
5
lfs.c
@@ -5256,11 +5256,12 @@ static int lfs_fs_grow_(lfs_t *lfs, lfs_size_t block_count) {
|
||||
LFS_ASSERT(block_count >= lfs->block_count);
|
||||
#endif
|
||||
#ifdef LFS_SHRINKNONRELOCATING
|
||||
lfs_block_t threshold = block_count;
|
||||
err = lfs_fs_traverse_(lfs, lfs_shrink_checkblock, &threshold, true);
|
||||
if (block_count < lfs->block_count) {
|
||||
err = lfs_fs_traverse_(lfs, lfs_shrink_checkblock, &block_count, true);
|
||||
if (err) {
|
||||
return err;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
lfs->block_count = block_count;
|
||||
|
||||
Reference in New Issue
Block a user