From 8690c887d1dcad384d44ca21bf950a4ec2fbffdb Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Thu, 18 May 2017 10:51:08 +0800 Subject: 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 --- cmds-restore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cmds-restore.c') diff --git a/cmds-restore.c b/cmds-restore.c index 09388b29..ae01430c 100644 --- a/cmds-restore.c +++ b/cmds-restore.c @@ -1255,7 +1255,7 @@ static struct btrfs_root *open_fs(const char *dev, u64 root_location, if (!root_location) root_location = btrfs_super_root(fs_info->super_copy); generation = btrfs_super_generation(fs_info->super_copy); - root->node = read_tree_block(root, root_location, + root->node = read_tree_block(fs_info, root_location, fs_info->nodesize, generation); if (!extent_buffer_uptodate(root->node)) { fprintf(stderr, "Error opening tree root\n"); @@ -1502,7 +1502,7 @@ int cmd_restore(int argc, char **argv) if (fs_location != 0) { free_extent_buffer(root->node); - root->node = read_tree_block(root, fs_location, + root->node = read_tree_block(root->fs_info, fs_location, root->fs_info->nodesize, 0); if (!extent_buffer_uptodate(root->node)) { fprintf(stderr, "Failed to read fs location\n"); -- cgit v1.2.3