aboutsummaryrefslogtreecommitdiffstats
path: root/volumes.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2016-02-22 14:59:55 +0800
committerDavid Sterba <dsterba@suse.com>2016-02-26 17:27:58 +0100
commit9db13dca2f00b8a7cfd31fb737cfd0e73ad48abf (patch)
treeadc2cea9c6e95ab693b657d092e29f3ea223cb44 /volumes.c
parent43318324d20cccccfacf2e82ac10e27eefb6cc95 (diff)
downloadbtrfs-progs-9db13dca2f00b8a7cfd31fb737cfd0e73ad48abf.tar.gz
btrfs-progs-9db13dca2f00b8a7cfd31fb737cfd0e73ad48abf.tar.xz
btrfs-progs-9db13dca2f00b8a7cfd31fb737cfd0e73ad48abf.zip
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 <quwenruo@cn.fujitsu.com> [ coding style adjustments, unified declarations ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'volumes.c')
-rw-r--r--volumes.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/volumes.c b/volumes.c
index 059c4f4..cc3e6b7 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;