Don't bother closing lfs->gc in lfsr_unmount

It makes the the are-any-files-still-open assert a bit uglier, but we
really don't need to bother calling lfsr_omdir_close here. We're done
with this struct anyways...

Not doing something saves a bit of code:

           code          stack
  before: 36240           2680
  after:  36208 (-0.1%)   2680 (+0.0%)
This commit is contained in:
Christopher Haster
2024-07-17 03:12:16 -05:00
parent 6cf78527b4
commit ad4051b5a2
+3 -6
View File
@@ -12677,13 +12677,10 @@ failed:;
}
int lfsr_unmount(lfs_t *lfs) {
// close any ongoing gc traversals
if (lfsr_omdir_isopen(lfs, &lfs->gc.o.o)) {
lfsr_omdir_close(lfs, &lfs->gc.o.o);
}
// all files/dirs should be closed before lfsr_unmount
LFS_ASSERT(lfs->omdirs == NULL);
LFS_ASSERT(lfs->omdirs == NULL
|| (lfs->omdirs == &lfs->gc.o.o
&& lfs->gc.o.o.next == NULL));
return lfs_deinit(lfs);
}