From 08c9d7dd155c538d572396f707d0c59b5a98923f Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Tue, 16 Jul 2024 19:09:50 -0500 Subject: [PATCH] Renamed lfsr_mdir_fixorphans -> lfsr_fs_fixorphans_ This is mainly to avoid confusion around if lfs_alloc_ckpoint needs to be called before this function. I guess it's not problematic to call lfs_alloc_ckpoint unnecessarily... but unlike every other lfsr_mdir_* function we call lfs_alloc_ckpoint internally for every orphan we fix. Otherwise we could end up with ENOSPC too early. lfsr_fs_fixorphans_ is really only internal glue between lfsr_fs_fixorphans and lfsr_mtree_gc anyways... --- lfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lfs.c b/lfs.c index b244610e..a4cdb5c2 100644 --- a/lfs.c +++ b/lfs.c @@ -8690,7 +8690,7 @@ static int lfsr_mtree_traverse(lfs_t *lfs, lfsr_traversal_t *t, } // needed in lfsr_mtree_gc -static int lfsr_mdir_fixorphans(lfs_t *lfs, lfsr_mdir_t *mdir); +static int lfsr_fs_fixorphans_(lfs_t *lfs, lfsr_mdir_t *mdir); static void lfs_alloc_ckpoint(lfs_t *lfs); static void lfs_alloc_markfree(lfs_t *lfs); @@ -8722,7 +8722,7 @@ dropped:; && tag == LFSR_TAG_MDIR && lfsr_f_hasorphans(lfs->flags)) { lfsr_mdir_t *mdir = (lfsr_mdir_t*)bptr.data.u.buffer; - err = lfsr_mdir_fixorphans(lfs, mdir); + err = lfsr_fs_fixorphans_(lfs, mdir); if (err) { goto failed; } @@ -12936,7 +12936,7 @@ static int lfsr_fs_fixgrm(lfs_t *lfs) { return 0; } -static int lfsr_mdir_fixorphans(lfs_t *lfs, lfsr_mdir_t *mdir) { +static int lfsr_fs_fixorphans_(lfs_t *lfs, lfsr_mdir_t *mdir) { // save the current mid lfsr_mid_t mid = mdir->mid;