diff --git a/lfs.c b/lfs.c index a0bd76fd..c14efaac 100644 --- a/lfs.c +++ b/lfs.c @@ -688,7 +688,7 @@ static int lfs_alloc(lfs_t *lfs, lfs_block_t *block) { if (lfs->lookahead.ckpoint <= 0) { LFS_ERROR("No more free space 0x%"PRIx32, (lfs->lookahead.start + lfs->lookahead.next) - % lfs->cfg->block_count); + % lfs->block_count); return LFS_ERR_NOSPC; } diff --git a/lfs.h b/lfs.h index 99145022..274259e2 100644 --- a/lfs.h +++ b/lfs.h @@ -204,6 +204,7 @@ struct lfs_config { lfs_size_t block_size; // Number of erasable blocks on the device. + // If 0, will attempt to infer block_count from existing filesystem. lfs_size_t block_count; // Number of erase cycles before littlefs evicts metadata logs and moves