Skip to content

Commit 4defaa6

Browse files
committed
Squashed 'littlefs/' changes from 16ceb67..8e251dd
8e251dd Merge pull request #1110 from Ryan-CW-Code/perf_gc 25b9a4a Merge pull request #1109 from Ryan-CW-Code/never_read 2acf939 Merge pull request #1106 from littlefs-project/fix-make-build-dep d5a86fd style: format code, limit to 80 columns. 2349ac8 perf: gc might try to populate the lookahead buffer each time 0755b00 refactor: value stored to 'diff' is never read 8365bbb make: Added missing BUILD_DEP include git-subtree-dir: littlefs git-subtree-split: 8e251dd675da00342d45dac78b6f627f119aed03
1 parent d74bde6 commit 4defaa6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ benchmarks-diff: $(BENCH_CSV)
475475
# rules
476476
-include $(DEP)
477477
-include $(TEST_DEP)
478+
-include $(BENCH_DEP)
478479
.SUFFIXES:
479480
.SECONDARY:
480481

lfs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -828,9 +828,6 @@ static int lfs_dir_getread(lfs_t *lfs, const lfs_mdir_t *dir,
828828
size -= diff;
829829
continue;
830830
}
831-
832-
// rcache takes priority
833-
diff = lfs_min(diff, rcache->off-off);
834831
}
835832

836833
// load to cache, first condition can no longer fail
@@ -5225,7 +5222,9 @@ static int lfs_fs_gc_(lfs_t *lfs) {
52255222
}
52265223

52275224
// try to populate the lookahead buffer, unless it's already full
5228-
if (lfs->lookahead.size < 8*lfs->cfg->lookahead_size) {
5225+
if (lfs->lookahead.size < lfs_min(
5226+
8 * lfs->cfg->lookahead_size,
5227+
lfs->block_count)) {
52295228
err = lfs_alloc_scan(lfs);
52305229
if (err) {
52315230
return err;

0 commit comments

Comments
 (0)