Skip to content

Commit 7d79423

Browse files
Rename SHRINKIFCHEAP to SHRINKNONRELOCATING
1 parent 7782d3d commit 7d79423

5 files changed

Lines changed: 8 additions & 8 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ jobs:
388388
python3 --version
389389
- name: test-no-intrinsics
390390
run: |
391-
CFLAGS="$CFLAGS -DLFS_SHRINKIFCHEAP" make test
391+
CFLAGS="$CFLAGS -DLFS_SHRINKNONRELOCATING" make test
392392
393393
# run with all trace options enabled to at least make sure these
394394
# all compile

lfs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5233,7 +5233,7 @@ static int lfs_fs_gc_(lfs_t *lfs) {
52335233
#endif
52345234

52355235
#ifndef LFS_READONLY
5236-
#ifdef LFS_SHRINKIFCHEAP
5236+
#ifdef LFS_SHRINKNONRELOCATING
52375237
static int lfs_shrink_checkblock(void * data, lfs_block_t block) {
52385238
lfs_size_t threshold = *((lfs_size_t *) data);
52395239
if (block >= threshold) {
@@ -5251,11 +5251,11 @@ static int lfs_fs_grow_(lfs_t *lfs, lfs_size_t block_count) {
52515251
}
52525252

52535253

5254-
#ifndef LFS_SHRINKIFCHEAP
5254+
#ifndef LFS_SHRINKNONRELOCATING
52555255
// shrinking is not supported
52565256
LFS_ASSERT(block_count >= lfs->block_count);
52575257
#endif
5258-
#ifdef LFS_SHRINKIFCHEAP
5258+
#ifdef LFS_SHRINKNONRELOCATING
52595259
lfs_block_t threshold = block_count;
52605260
err = lfs_fs_traverse_(lfs, lfs_shrink_checkblock, &threshold, true);
52615261
if (err) {

lfs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ int lfs_fs_gc(lfs_t *lfs);
766766
// Grows the filesystem to a new size, updating the superblock with the new
767767
// block count.
768768
//
769-
// If LFS_SHRINKIFCHEAP is defined, this function will also accept
769+
// If LFS_SHRINKNONRELOCATING is defined, this function will also accept
770770
// block_counts smaller than the current configuration, after checking
771771
// that none of the blocks that are being removed are in use.
772772
// Note that littlefs's pseudorandom block allocation means that

tests/test_shrink.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ defines.AFTER_BLOCK_COUNT = [5, 10, 15, 19]
55

66
if = "AFTER_BLOCK_COUNT <= BLOCK_COUNT"
77
code = '''
8-
#ifdef LFS_SHRINKIFCHEAP
8+
#ifdef LFS_SHRINKNONRELOCATING
99
lfs_t lfs;
1010
lfs_format(&lfs, cfg) => 0;
1111
lfs_mount(&lfs, cfg) => 0;
@@ -30,7 +30,7 @@ defines.AFTER_BLOCK_COUNT = [5, 7, 10, 12, 15, 17, 20]
3030
defines.FILES_COUNT = [7, 8, 9, 10]
3131
if = "AFTER_BLOCK_COUNT <= BLOCK_COUNT && FILES_COUNT + 2 < BLOCK_COUNT"
3232
code = '''
33-
#ifdef LFS_SHRINKIFCHEAP
33+
#ifdef LFS_SHRINKNONRELOCATING
3434
lfs_t lfs;
3535
lfs_format(&lfs, cfg) => 0;
3636
// create FILES_COUNT files of BLOCK_SIZE - 50 bytes (to avoid inlining)

tests/test_superblocks.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ defines.BLOCK_COUNT = 'ERASE_COUNT'
531531
defines.BLOCK_COUNT_2 = ['ERASE_COUNT/2', 'ERASE_COUNT/4', '2']
532532
defines.KNOWN_BLOCK_COUNT = [true, false]
533533
code = '''
534-
#ifdef LFS_SHRINKIFCHEAP
534+
#ifdef LFS_SHRINKNONRELOCATING
535535
lfs_t lfs;
536536
lfs_format(&lfs, cfg) => 0;
537537

0 commit comments

Comments
 (0)