summaryrefslogtreecommitdiff
path: root/cmds-inspect-dump-tree.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2017-05-18 10:51:08 +0800
committerDavid Sterba <dsterba@suse.com>2017-07-03 13:35:11 +0200
commit8690c887d1dcad384d44ca21bf950a4ec2fbffdb (patch)
treebf736b51824e4e834c4d0e8ea79169bf40849d04 /cmds-inspect-dump-tree.c
parent060c7b3a1a40d2e9cacbdb37a02791bacae32491 (diff)
btrfs-progs: Refactor read_tree_block to get rid of btrfs_root
The only reasom read_tree_block() needs a btrfs_root parameter is to get its node/sector size. And long ago, I have already introduced a compactible interface, read_tree_block_fs_info() to pass btrfs_fs_info instead of btrfs_root. Since we have cleaned up all root->sector/node/stripesize users, we should be OK to refactor read_tree_block() function. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Diffstat (limited to 'cmds-inspect-dump-tree.c')
-rw-r--r--cmds-inspect-dump-tree.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/cmds-inspect-dump-tree.c b/cmds-inspect-dump-tree.c
index 869ad6ba..93dff086 100644
--- a/cmds-inspect-dump-tree.c
+++ b/cmds-inspect-dump-tree.c
@@ -52,7 +52,8 @@ static void print_extents(struct btrfs_root *root, struct extent_buffer *eb)
size = root->fs_info->nodesize;
nr = btrfs_header_nritems(eb);
for (i = 0; i < nr; i++) {
- next = read_tree_block(root, btrfs_node_blockptr(eb, i),
+ next = read_tree_block(root->fs_info,
+ btrfs_node_blockptr(eb, i),
size, btrfs_node_ptr_generation(eb, i));
if (!extent_buffer_uptodate(next))
continue;
@@ -311,7 +312,7 @@ int cmd_inspect_dump_tree(int argc, char **argv)
}
if (block_only) {
- leaf = read_tree_block(root,
+ leaf = read_tree_block(info,
block_only,
info->nodesize, 0);
@@ -322,7 +323,7 @@ int cmd_inspect_dump_tree(int argc, char **argv)
}
if (!leaf) {
- leaf = read_tree_block(root,
+ leaf = read_tree_block(info,
block_only,
info->nodesize, 0);
}
@@ -439,8 +440,7 @@ again:
offset = btrfs_item_ptr_offset(leaf, slot);
read_extent_buffer(leaf, &ri, offset, sizeof(ri));
- buf = read_tree_block(tree_root_scan,
- btrfs_root_bytenr(&ri),
+ buf = read_tree_block(info, btrfs_root_bytenr(&ri),
info->nodesize, 0);
if (!extent_buffer_uptodate(buf))
goto next;