diff --git a/source/fs/mufs/tree.c b/source/fs/mufs/tree.c index 1cf00ec..a37f516 100644 --- a/source/fs/mufs/tree.c +++ b/source/fs/mufs/tree.c @@ -12,6 +12,21 @@ #include "dir.h" #include "tree.h" +void mufs_del_tree(struct mufs_tree *tree) +{ + struct mufs *fs; + + if (!tree) + return; + + fs = tree->fs; + + if (tree == &fs->root) + return; + + free(tree); +} + static int mufs_do_lookup(struct mufs *fs, uint32_t *page, uint32_t base, uint8_t depth, uint32_t va, uint32_t new_page, unsigned alloc) diff --git a/source/fs/mufs/tree.h b/source/fs/mufs/tree.h index bc3f0c6..efbf0e6 100644 --- a/source/fs/mufs/tree.h +++ b/source/fs/mufs/tree.h @@ -1,5 +1,6 @@ #pragma once +void mufs_del_tree(struct mufs_tree *tree); int mufs_lookup_page(struct mufs_tree *tree, uint32_t *page, uint32_t va); int mufs_map_page(struct mufs_tree *tree, uint32_t va, uint32_t page);