diff --git a/lfs3.c b/lfs3.c index 3b125e7e..93e1386c 100644 --- a/lfs3.c +++ b/lfs3.c @@ -16824,6 +16824,16 @@ int lfs3_fs_mkconsistent(lfs3_t *lfs3) { } } + // go ahead and checkpoint the allocator + // + // this isn't always needed, but redundant alloc ckpoints are noops, + // so might as well to eagerly populate allocators and save some + // code + int err = lfs3_alloc_ckpoint(lfs3); + if (err) { + return err; + } + return 0; } #endif @@ -17137,13 +17147,6 @@ int lfs3_fs_mkgbmap(lfs3_t *lfs3) { return err; } - // checkpoint the allocator - // TODO, should lfs3_fs_mkconsistent also checkpoint the allocator? - err = lfs3_alloc_ckpoint(lfs3); - if (err) { - return err; - } - // create an empty gbmap lfs3_gbmap_init(&lfs3->gbmap);