From 8365bbb7a2ce23388654cac7cef957e1d300b535 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Thu, 15 May 2025 13:38:31 -0500 Subject: [PATCH 1/4] make: Added missing BUILD_DEP include This was preventing bench modifications from triggering relevant bench-runner rebuilds. --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 588e095d..909223ad 100644 --- a/Makefile +++ b/Makefile @@ -475,6 +475,7 @@ benchmarks-diff: $(BENCH_CSV) # rules -include $(DEP) -include $(TEST_DEP) +-include $(BENCH_DEP) .SUFFIXES: .SECONDARY: From 0755b00c215af570fff800061074f939379d8f10 Mon Sep 17 00:00:00 2001 From: ryancw <1831931681@qq.com> Date: Tue, 27 May 2025 20:00:29 +0800 Subject: [PATCH 2/4] refactor: value stored to 'diff' is never read --- lfs.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/lfs.c b/lfs.c index c0b0ba38..b8d22e21 100644 --- a/lfs.c +++ b/lfs.c @@ -828,9 +828,6 @@ static int lfs_dir_getread(lfs_t *lfs, const lfs_mdir_t *dir, size -= diff; continue; } - - // rcache takes priority - diff = lfs_min(diff, rcache->off-off); } // load to cache, first condition can no longer fail From 2349ac8c96f719ce44b38114ffcc1f6b058b8159 Mon Sep 17 00:00:00 2001 From: ryancw <1831931681@qq.com> Date: Wed, 28 May 2025 10:23:47 +0800 Subject: [PATCH 3/4] perf: gc might try to populate the lookahead buffer each time --- lfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lfs.c b/lfs.c index c0b0ba38..cec48709 100644 --- a/lfs.c +++ b/lfs.c @@ -5225,7 +5225,7 @@ static int lfs_fs_gc_(lfs_t *lfs) { } // try to populate the lookahead buffer, unless it's already full - if (lfs->lookahead.size < 8*lfs->cfg->lookahead_size) { + if (lfs->lookahead.size < lfs_min(8 * lfs->cfg->lookahead_size, lfs->block_count)) { err = lfs_alloc_scan(lfs); if (err) { return err; From d5a86fd28de74dd1d5a6126d843b16276e6023cf Mon Sep 17 00:00:00 2001 From: ryancw <1831931681@qq.com> Date: Tue, 3 Jun 2025 09:46:59 +0800 Subject: [PATCH 4/4] style: format code, limit to 80 columns. --- lfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lfs.c b/lfs.c index cec48709..1126b2a3 100644 --- a/lfs.c +++ b/lfs.c @@ -5225,7 +5225,9 @@ static int lfs_fs_gc_(lfs_t *lfs) { } // try to populate the lookahead buffer, unless it's already full - if (lfs->lookahead.size < lfs_min(8 * lfs->cfg->lookahead_size, lfs->block_count)) { + if (lfs->lookahead.size < lfs_min( + 8 * lfs->cfg->lookahead_size, + lfs->block_count)) { err = lfs_alloc_scan(lfs); if (err) { return err;