From 43a6053d5ecccb8ce07ca42f09ad1bcb7406e1d5 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sat, 4 Oct 2025 12:45:15 -0500 Subject: [PATCH] alloc: Tried to simplify alloc info statements So now: lfs3.c:11482:info: Rebuilding bmap (bmap 37/256) lfs3.c:11246:error: No more free space (lookahead 0/256) Instead of the previously somewhat confusing: lfs3.c:11484:info: Rebuilding bmap (bmap 62/256/256) lfs3.c:11247:error: No more free space (lookahead 0/0/256) While the previous info statements did have more info (window + ckpoint + block count), usually one of these ended up redundant (window == ckpoint == 0 during ENOSPC, for example). --- lfs3.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/lfs3.c b/lfs3.c index c3e7c915..0696d8d8 100644 --- a/lfs3.c +++ b/lfs3.c @@ -11227,10 +11227,9 @@ static lfs3_sblock_t lfs3_alloc(lfs3_t *lfs3, uint32_t flags) { #ifdef LFS3_DBGALLOCS LFS3_DEBUG("Allocated block 0x%"PRIx32", " - "lookahead %"PRId32"/%"PRId32"/%"PRId32, + "lookahead %"PRId32"/%"PRId32, block, lfs3->lookahead.known, - lfs3->lookahead.ckpoint, lfs3->cfg->block_count); #endif return block; @@ -11245,9 +11244,8 @@ static lfs3_sblock_t lfs3_alloc(lfs3_t *lfs3, uint32_t flags) { // if (lfs3->lookahead.ckpoint <= 0) { LFS3_ERROR("No more free space " - "(lookahead %"PRId32"/%"PRId32"/%"PRId32")", + "(lookahead %"PRId32"/%"PRId32")", lfs3->lookahead.known, - lfs3->lookahead.ckpoint, lfs3->cfg->block_count); return LFS3_ERR_NOSPC; } @@ -11482,9 +11480,8 @@ static int lfs3_alloc_rebuildbmap(lfs3_t *lfs3) { // we should ckpoint before calling this LFS3_ASSERT(lfs3->lookahead.ckpoint == lfs3->cfg->block_count); LFS3_INFO("Rebuilding bmap " - "(bmap %"PRId32"/%"PRId32"/%"PRId32")", + "(bmap %"PRId32"/%"PRId32")", lfs3->lookahead.bmapped, - lfs3->lookahead.ckpoint, lfs3->cfg->block_count); // create a new bmap @@ -11542,9 +11539,8 @@ failed:; // not having enough space for the bmap isn't really an error if (err == LFS3_ERR_NOSPC) { LFS3_INFO("Not enough space for bmap " - "(lookahead %"PRId32"/%"PRId32"/%"PRId32")", + "(lookahead %"PRId32"/%"PRId32")", lfs3->lookahead.known, - lfs3->lookahead.ckpoint, lfs3->cfg->block_count); return 0; }