Skip to content

Commit 530ff95

Browse files
committed
Squashed 'littlefs/' changes from c733d9e..3513ff1
3513ff1 Merge pull request #911 from littlefs-project/fix-release-structs 8a22bd6 Merge pull request #910 from littlefs-project/fix-superblock-expansion-thresh 9b82db7 Merge pull request #898 from zchen24/patch-1 99b84ee Update DESIGN.md, fix minor typo e91a29d Fixed struct sizes missing from generated release notes b9b95ab Increase threshold for superblock expansion from ~50% -> ~88% full 10bcff1 Update DESIGN.md minor typo git-subtree-dir: littlefs git-subtree-split: 3513ff1afc1d67adb2e6f492f0b9bc0d798fcb0d
1 parent f7a270e commit 530ff95

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
table[$i,$j]=$c_camel
113113
((j+=1))
114114
115-
for s in code stack struct
115+
for s in code stack structs
116116
do
117117
f=sizes/thumb${c:+-$c}.$s.csv
118118
[ -e $f ] && table[$i,$j]=$( \

DESIGN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ This leaves us with three major requirements for an embedded filesystem.
5959
RAM to temporarily store filesystem metadata.
6060

6161
For ROM, this means we need to keep our design simple and reuse code paths
62-
were possible. For RAM we have a stronger requirement, all RAM usage is
62+
where possible. For RAM we have a stronger requirement, all RAM usage is
6363
bounded. This means RAM usage does not grow as the filesystem changes in
6464
size or number of files. This creates a unique challenge as even presumably
6565
simple operations, such as traversing the filesystem, become surprisingly
@@ -626,7 +626,7 @@ log₂_n_ pointers that skip to different preceding elements of the
626626
skip-list.
627627

628628
The name comes from heavy use of the [CTZ instruction][wikipedia-ctz], which
629-
lets us calculate the power-of-two factors efficiently. For a give block _n_,
629+
lets us calculate the power-of-two factors efficiently. For a given block _n_,
630630
that block contains ctz(_n_)+1 pointers.
631631

632632
```

lfs.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,9 +2151,11 @@ static int lfs_dir_splittingcompact(lfs_t *lfs, lfs_mdir_t *dir,
21512151
return size;
21522152
}
21532153

2154-
// do we have extra space? littlefs can't reclaim this space
2155-
// by itself, so expand cautiously
2156-
if ((lfs_size_t)size < lfs->block_count/2) {
2154+
// littlefs cannot reclaim expanded superblocks, so expand cautiously
2155+
//
2156+
// if our filesystem is more than ~88% full, don't expand, this is
2157+
// somewhat arbitrary
2158+
if (lfs->block_count - size > lfs->block_count/8) {
21572159
LFS_DEBUG("Expanding superblock at rev %"PRIu32, dir->rev);
21582160
int err = lfs_dir_split(lfs, dir, attrs, attrcount,
21592161
source, begin, end);

0 commit comments

Comments
 (0)