mufs: allocate a block for the root, if no root has been allocated in mufs_alloc_page()
This commit is contained in:
parent
55ce3b8798
commit
abe656c640
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue