summaryrefslogtreecommitdiff
path: root/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-11 13:57:55 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-11 13:57:55 -0400
commitd23ea8706c91d5a625454de67c9700dfa688d8b5 (patch)
tree6498384895e38e612dad4a720674542b7859c8ad /disk-io.c
parent6d9ce71c8162d7cc940f38d06c15b4e3e3552d8d (diff)
early support for multiple devices
Diffstat (limited to 'disk-io.c')
-rw-r--r--disk-io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/disk-io.c b/disk-io.c
index 448482fb..dff3bd57 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -273,6 +273,7 @@ struct btrfs_root *open_ctree_fd(int fp, struct btrfs_super_block *super)
struct btrfs_root *root = malloc(sizeof(struct btrfs_root));
struct btrfs_root *extent_root = malloc(sizeof(struct btrfs_root));
struct btrfs_root *tree_root = malloc(sizeof(struct btrfs_root));
+ struct btrfs_root *dev_root = malloc(sizeof(struct btrfs_root));
struct btrfs_fs_info *fs_info = malloc(sizeof(*fs_info));
int ret;
@@ -286,6 +287,7 @@ struct btrfs_root *open_ctree_fd(int fp, struct btrfs_super_block *super)
fs_info->fs_root = root;
fs_info->tree_root = tree_root;
fs_info->extent_root = extent_root;
+ fs_info->dev_root = dev_root;
fs_info->last_inode_alloc = 0;
fs_info->last_inode_alloc_dirid = 0;
fs_info->disk_super = super;
@@ -299,6 +301,10 @@ struct btrfs_root *open_ctree_fd(int fp, struct btrfs_super_block *super)
return NULL;
}
BUG_ON(ret < 0);
+ __setup_root(super, dev_root, fs_info, BTRFS_DEV_TREE_OBJECTID, fp);
+ dev_root->node = read_tree_block(dev_root,
+ btrfs_super_device_root(super));
+
__setup_root(super, tree_root, fs_info, BTRFS_ROOT_TREE_OBJECTID, fp);
tree_root->node = read_tree_block(tree_root, btrfs_super_root(super));
BUG_ON(!tree_root->node);