Switched lfsr_fs_ckmeta/ckdata to use lfsr_mtree_traverse

These should never need to mutate the filesystem, so calling
lfsr_mtree_gc doesn't really make sense. This mainly matters for
link-time gc in case we never need lfsr_mtree_gc (readonly mode?).

Unfortunately this adds a code cost because the optional pointers to
lfsr_mtree_traverse can no longer be const-propagated:

           code          stack
  before: 36284           2704
  after:  36292 (+0.0%)   2704 (+0.0%)
This commit is contained in:
Christopher Haster
2024-07-24 13:30:09 -05:00
parent fb3c0daa0a
commit ff4cc52ebb
+4 -4
View File
@@ -12995,10 +12995,10 @@ int lfsr_fs_mkconsistent(lfs_t *lfs) {
// check the filesystem for metadata errors
int lfsr_fs_ckmeta(lfs_t *lfs) {
// we leave this up to lfsr_mtree_gc
// we leave this up to lfsr_mtree_traverse
lfsr_traversal_t t = LFSR_TRAVERSAL(LFS_T_CKMETA);
while (true) {
int err = lfsr_mtree_gc(lfs, &t,
int err = lfsr_mtree_traverse(lfs, &t,
NULL, NULL);
if (err) {
if (err == LFS_ERR_NOENT) {
@@ -13013,10 +13013,10 @@ int lfsr_fs_ckmeta(lfs_t *lfs) {
// check the filesystem for metadata + data errors
int lfsr_fs_ckdata(lfs_t *lfs) {
// we leave this up to lfsr_mtree_gc
// we leave this up to lfsr_mtree_traverse
lfsr_traversal_t t = LFSR_TRAVERSAL(LFS_T_CKMETA | LFS_T_CKDATA);
while (true) {
int err = lfsr_mtree_gc(lfs, &t,
int err = lfsr_mtree_traverse(lfs, &t,
NULL, NULL);
if (err) {
if (err == LFS_ERR_NOENT) {