From 9db13dca2f00b8a7cfd31fb737cfd0e73ad48abf Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Mon, 22 Feb 2016 14:59:55 +0800 Subject: btrfs-progs: Add support for tree block operations on fs_info without roots Since open_ctree_fs_info() now may return a fs_info even without any roots, modify functions like read_tree_block() to operate with such fs_info. This provides the basis for btrfs-find-root to operate on chunk tree with corrupted fs. Signed-off-by: Qu Wenruo [ coding style adjustments, unified declarations ] Signed-off-by: David Sterba --- volumes.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'volumes.c') diff --git a/volumes.c b/volumes.c index 059c4f42..cc3e6b7f 100644 --- a/volumes.c +++ b/volumes.c @@ -1840,7 +1840,8 @@ int btrfs_read_sys_array(struct btrfs_root *root) u32 cur_offset; struct btrfs_key key; - sb = btrfs_find_create_tree_block(root, BTRFS_SUPER_INFO_OFFSET, + sb = btrfs_find_create_tree_block(root->fs_info, + BTRFS_SUPER_INFO_OFFSET, BTRFS_SUPER_INFO_SIZE); if (!sb) return -ENOMEM; -- cgit v1.2.3