diff options
author | Stefan Behrens <sbehrens@giantdisaster.de> | 2012-11-05 09:46:42 -0500 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2012-12-12 17:15:34 -0500 |
commit | 3ec706c831d4c96905c287013c8228b21619a1d9 (patch) | |
tree | b5f8ac6333bd0d54b87f4d367aaf3d6101eeef5b /fs/btrfs/volumes.c | |
parent | 5d9640517d92d05843711ea982cbeff42d7ed32d (diff) |
Btrfs: pass fs_info to btrfs_map_block() instead of mapping_tree
This is required for the device replace procedure in a later step.
Two calling functions also had to be changed to have the fs_info
pointer: repair_io_failure() and scrub_setup_recheck_block().
Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 5612767b910e..96bb2e4446aa 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -3826,13 +3826,14 @@ static int find_live_mirror(struct map_lookup *map, int first, int num, | |||
3826 | return optimal; | 3826 | return optimal; |
3827 | } | 3827 | } |
3828 | 3828 | ||
3829 | static int __btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, | 3829 | static int __btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, |
3830 | u64 logical, u64 *length, | 3830 | u64 logical, u64 *length, |
3831 | struct btrfs_bio **bbio_ret, | 3831 | struct btrfs_bio **bbio_ret, |
3832 | int mirror_num) | 3832 | int mirror_num) |
3833 | { | 3833 | { |
3834 | struct extent_map *em; | 3834 | struct extent_map *em; |
3835 | struct map_lookup *map; | 3835 | struct map_lookup *map; |
3836 | struct btrfs_mapping_tree *map_tree = &fs_info->mapping_tree; | ||
3836 | struct extent_map_tree *em_tree = &map_tree->map_tree; | 3837 | struct extent_map_tree *em_tree = &map_tree->map_tree; |
3837 | u64 offset; | 3838 | u64 offset; |
3838 | u64 stripe_offset; | 3839 | u64 stripe_offset; |
@@ -4061,11 +4062,11 @@ out: | |||
4061 | return ret; | 4062 | return ret; |
4062 | } | 4063 | } |
4063 | 4064 | ||
4064 | int btrfs_map_block(struct btrfs_mapping_tree *map_tree, int rw, | 4065 | int btrfs_map_block(struct btrfs_fs_info *fs_info, int rw, |
4065 | u64 logical, u64 *length, | 4066 | u64 logical, u64 *length, |
4066 | struct btrfs_bio **bbio_ret, int mirror_num) | 4067 | struct btrfs_bio **bbio_ret, int mirror_num) |
4067 | { | 4068 | { |
4068 | return __btrfs_map_block(map_tree, rw, logical, length, bbio_ret, | 4069 | return __btrfs_map_block(fs_info, rw, logical, length, bbio_ret, |
4069 | mirror_num); | 4070 | mirror_num); |
4070 | } | 4071 | } |
4071 | 4072 | ||
@@ -4394,7 +4395,6 @@ static void bbio_error(struct btrfs_bio *bbio, struct bio *bio, u64 logical) | |||
4394 | int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, | 4395 | int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, |
4395 | int mirror_num, int async_submit) | 4396 | int mirror_num, int async_submit) |
4396 | { | 4397 | { |
4397 | struct btrfs_mapping_tree *map_tree; | ||
4398 | struct btrfs_device *dev; | 4398 | struct btrfs_device *dev; |
4399 | struct bio *first_bio = bio; | 4399 | struct bio *first_bio = bio; |
4400 | u64 logical = (u64)bio->bi_sector << 9; | 4400 | u64 logical = (u64)bio->bi_sector << 9; |
@@ -4406,10 +4406,9 @@ int btrfs_map_bio(struct btrfs_root *root, int rw, struct bio *bio, | |||
4406 | struct btrfs_bio *bbio = NULL; | 4406 | struct btrfs_bio *bbio = NULL; |
4407 | 4407 | ||
4408 | length = bio->bi_size; | 4408 | length = bio->bi_size; |
4409 | map_tree = &root->fs_info->mapping_tree; | ||
4410 | map_length = length; | 4409 | map_length = length; |
4411 | 4410 | ||
4412 | ret = btrfs_map_block(map_tree, rw, logical, &map_length, &bbio, | 4411 | ret = btrfs_map_block(root->fs_info, rw, logical, &map_length, &bbio, |
4413 | mirror_num); | 4412 | mirror_num); |
4414 | if (ret) /* -ENOMEM */ | 4413 | if (ret) /* -ENOMEM */ |
4415 | return ret; | 4414 | return ret; |