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:
@@ -12677,13 +12677,10 @@ failed:;
|
|||||||
}
|
}
|
||||||
|
|
||||||
int lfsr_unmount(lfs_t *lfs) {
|
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
|
// 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);
|
return lfs_deinit(lfs);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user