u64 objectid)
{
root->node = NULL;
- root->inode = NULL;
root->commit_root = NULL;
root->ref_tree = NULL;
root->sectorsize = sectorsize;
u32 blocksize;
u32 stripesize;
u64 generation;
+ struct btrfs_key location;
struct buffer_head *bh;
struct btrfs_root *extent_root = kzalloc(sizeof(struct btrfs_root),
GFP_NOFS);
goto fail_cleaner;
if (sb->s_flags & MS_RDONLY)
- return tree_root;
+ goto read_fs_root;
if (btrfs_super_log_root(disk_super) != 0) {
u32 blocksize;
ret = btrfs_cleanup_reloc_trees(tree_root);
BUG_ON(ret);
+ location.objectid = BTRFS_FS_TREE_OBJECTID;
+ location.type = BTRFS_ROOT_ITEM_KEY;
+ location.offset = (u64)-1;
+
+read_fs_root:
+ fs_info->fs_root = btrfs_read_fs_root_no_name(fs_info, &location);
+ if (!fs_info->fs_root)
+ goto fail_cleaner;
return tree_root;
fail_cleaner:
(unsigned long)root->root_key.objectid);
if (root->in_sysfs)
btrfs_sysfs_del_root(root);
- if (root->inode)
- iput(root->inode);
if (root->node)
free_extent_buffer(root->node);
if (root->commit_root)