diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2016-02-22 14:59:55 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-02-26 17:27:58 +0100 |
commit | 9db13dca2f00b8a7cfd31fb737cfd0e73ad48abf (patch) | |
tree | adc2cea9c6e95ab693b657d092e29f3ea223cb44 /extent-tree.c | |
parent | 43318324d20cccccfacf2e82ac10e27eefb6cc95 (diff) |
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 'extent-tree.c')
-rw-r--r-- | extent-tree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/extent-tree.c b/extent-tree.c index 1650bdb7..b9b00f06 100644 --- a/extent-tree.c +++ b/extent-tree.c @@ -2822,7 +2822,8 @@ struct extent_buffer *btrfs_alloc_free_block(struct btrfs_trans_handle *trans, return ERR_PTR(ret); } - buf = btrfs_find_create_tree_block(root, ins.objectid, blocksize); + buf = btrfs_find_create_tree_block(root->fs_info, ins.objectid, + blocksize); if (!buf) { btrfs_free_extent(trans, root, ins.objectid, ins.offset, 0, root->root_key.objectid, level, 0); |