summaryrefslogtreecommitdiff
path: root/chunk-recover.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2017-06-13 17:19:29 +0800
committerDavid Sterba <dsterba@suse.com>2017-07-12 17:53:36 +0200
commitde5d0cea24a716d0fa9fcab6b9cae858fadd8568 (patch)
tree2c2b05fee5f048e896ec1d0a52752d88148e3805 /chunk-recover.c
parent505639ee62adf3ec31ba2c7b276d49ecc44c000c (diff)
btrfs-progs: Refactor btrfs_find_device to use btrfs_fs_info
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'chunk-recover.c')
-rw-r--r--chunk-recover.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/chunk-recover.c b/chunk-recover.c
index 08d2f07e..90791fbd 100644
--- a/chunk-recover.c
+++ b/chunk-recover.c
@@ -942,11 +942,12 @@ static int build_device_map_by_chunk_record(struct btrfs_root *root,
u64 devid;
u8 uuid[BTRFS_UUID_SIZE];
u16 num_stripes;
+ struct btrfs_fs_info *fs_info = root->fs_info;
struct btrfs_mapping_tree *map_tree;
struct map_lookup *map;
struct stripe *stripe;
- map_tree = &root->fs_info->mapping_tree;
+ map_tree = &fs_info->mapping_tree;
num_stripes = chunk->num_stripes;
map = malloc(btrfs_map_lookup_size(num_stripes));
if (!map)
@@ -965,7 +966,7 @@ static int build_device_map_by_chunk_record(struct btrfs_root *root,
devid = stripe->devid;
memcpy(uuid, stripe->dev_uuid, BTRFS_UUID_SIZE);
map->stripes[i].physical = stripe->offset;
- map->stripes[i].dev = btrfs_find_device(root, devid,
+ map->stripes[i].dev = btrfs_find_device(fs_info, devid,
uuid, NULL);
if (!map->stripes[i].dev) {
free(map);