btrfs-progs: Refactor sectorsize users in cmds-inspect-dump-tree.c

Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
This commit is contained in:
Qu Wenruo 2017-05-18 10:21:34 +08:00 committed by David Sterba
parent ec5a427fec
commit 7a30f5a01c

View File

@ -49,7 +49,7 @@ static void print_extents(struct btrfs_root *root, struct extent_buffer *eb)
return;
}
size = root->nodesize;
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),
@ -313,7 +313,7 @@ int cmd_inspect_dump_tree(int argc, char **argv)
if (block_only) {
leaf = read_tree_block(root,
block_only,
root->nodesize, 0);
info->nodesize, 0);
if (extent_buffer_uptodate(leaf) &&
btrfs_header_level(leaf) != 0) {
@ -324,7 +324,7 @@ int cmd_inspect_dump_tree(int argc, char **argv)
if (!leaf) {
leaf = read_tree_block(root,
block_only,
root->nodesize, 0);
info->nodesize, 0);
}
if (!extent_buffer_uptodate(leaf)) {
error("failed to read %llu",
@ -441,8 +441,7 @@ again:
read_extent_buffer(leaf, &ri, offset, sizeof(ri));
buf = read_tree_block(tree_root_scan,
btrfs_root_bytenr(&ri),
tree_root_scan->nodesize,
0);
info->nodesize, 0);
if (!extent_buffer_uptodate(buf))
goto next;
if (tree_id && found_key.objectid != tree_id) {