From: Qu Wenruo Date: Thu, 18 May 2017 02:21:34 +0000 (+0800) Subject: btrfs-progs: Refactor sectorsize users in cmds-inspect-dump-tree.c X-Git-Tag: upstream/4.16.1~596 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a30f5a01c82faf1a3d86930613342c27ec12dd3;p=platform%2Fupstream%2Fbtrfs-progs.git btrfs-progs: Refactor sectorsize users in cmds-inspect-dump-tree.c Signed-off-by: Qu Wenruo --- diff --git a/cmds-inspect-dump-tree.c b/cmds-inspect-dump-tree.c index 5a5ca53..869ad6b 100644 --- a/cmds-inspect-dump-tree.c +++ b/cmds-inspect-dump-tree.c @@ -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) {