mufs: allocate a block for the root, if no root has been allocated in mufs_alloc_page()

tags/0.1.0
S.J.R. van Schaik 8 years ago
parent 55ce3b8798
commit abe656c640
  1. 3
      source/fs/mufs/tree.c

@ -49,6 +49,9 @@ int mufs_lookup_page(struct mufs *fs, struct mufs_tree *tree, uint32_t *page,
int mufs_alloc_page(struct mufs *fs, struct mufs_tree *tree, uint32_t *page,
uint32_t va)
{
if (!tree->root && mufs_alloc_block(fs, &tree->root) < 0)
return -1;
return mufs_do_lookup(fs, page, tree->root, tree->depth, va, 1);
}

Loading…
Cancel
Save