Commit 723b8bb1 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David Sterba

btrfs: open code btrfs_map_sblock

btrfs_map_sblock just hard codes three arguments and calls
btrfs_map_sblock.  Remove it as it doesn't provide any real value, but
makes following the btrfs_map_block call chains harder.
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent cd4efd21
...@@ -888,8 +888,9 @@ static void scrub_stripe_report_errors(struct scrub_ctx *sctx, ...@@ -888,8 +888,9 @@ static void scrub_stripe_report_errors(struct scrub_ctx *sctx,
/* For scrub, our mirror_num should always start at 1. */ /* For scrub, our mirror_num should always start at 1. */
ASSERT(stripe->mirror_num >= 1); ASSERT(stripe->mirror_num >= 1);
ret = btrfs_map_sblock(fs_info, BTRFS_MAP_GET_READ_MIRRORS, ret = btrfs_map_block(fs_info, BTRFS_MAP_GET_READ_MIRRORS,
stripe->logical, &mapped_len, &bioc); stripe->logical, &mapped_len, &bioc,
NULL, NULL, 1);
/* /*
* If we failed, dev will be NULL, and later detailed reports * If we failed, dev will be NULL, and later detailed reports
* will just be skipped. * will just be skipped.
...@@ -1921,8 +1922,8 @@ static int scrub_raid56_parity_stripe(struct scrub_ctx *sctx, ...@@ -1921,8 +1922,8 @@ static int scrub_raid56_parity_stripe(struct scrub_ctx *sctx,
bio->bi_end_io = raid56_scrub_wait_endio; bio->bi_end_io = raid56_scrub_wait_endio;
btrfs_bio_counter_inc_blocked(fs_info); btrfs_bio_counter_inc_blocked(fs_info);
ret = btrfs_map_sblock(fs_info, BTRFS_MAP_WRITE, full_stripe_start, ret = btrfs_map_block(fs_info, BTRFS_MAP_WRITE, full_stripe_start,
&length, &bioc); &length, &bioc, NULL, NULL, 1);
if (ret < 0) { if (ret < 0) {
btrfs_put_bioc(bioc); btrfs_put_bioc(bioc);
btrfs_bio_counter_dec(fs_info); btrfs_bio_counter_dec(fs_info);
......
...@@ -6481,15 +6481,6 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op, ...@@ -6481,15 +6481,6 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
return ret; return ret;
} }
/* For Scrub/replace */
int btrfs_map_sblock(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
u64 logical, u64 *length,
struct btrfs_io_context **bioc_ret)
{
return btrfs_map_block(fs_info, op, logical, length, bioc_ret,
NULL, NULL, 1);
}
static bool dev_args_match_fs_devices(const struct btrfs_dev_lookup_args *args, static bool dev_args_match_fs_devices(const struct btrfs_dev_lookup_args *args,
const struct btrfs_fs_devices *fs_devices) const struct btrfs_fs_devices *fs_devices)
{ {
......
...@@ -582,9 +582,6 @@ static inline unsigned long btrfs_chunk_item_size(int num_stripes) ...@@ -582,9 +582,6 @@ static inline unsigned long btrfs_chunk_item_size(int num_stripes)
void btrfs_get_bioc(struct btrfs_io_context *bioc); void btrfs_get_bioc(struct btrfs_io_context *bioc);
void btrfs_put_bioc(struct btrfs_io_context *bioc); void btrfs_put_bioc(struct btrfs_io_context *bioc);
int btrfs_map_sblock(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
u64 logical, u64 *length,
struct btrfs_io_context **bioc_ret);
int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op, int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
u64 logical, u64 *length, u64 logical, u64 *length,
struct btrfs_io_context **bioc_ret, struct btrfs_io_context **bioc_ret,
......
...@@ -1799,8 +1799,8 @@ static int read_zone_info(struct btrfs_fs_info *fs_info, u64 logical, ...@@ -1799,8 +1799,8 @@ static int read_zone_info(struct btrfs_fs_info *fs_info, u64 logical,
int nmirrors; int nmirrors;
int i, ret; int i, ret;
ret = btrfs_map_sblock(fs_info, BTRFS_MAP_GET_READ_MIRRORS, logical, ret = btrfs_map_block(fs_info, BTRFS_MAP_GET_READ_MIRRORS, logical,
&mapped_length, &bioc); &mapped_length, &bioc, NULL, NULL, 1);
if (ret || !bioc || mapped_length < PAGE_SIZE) { if (ret || !bioc || mapped_length < PAGE_SIZE) {
ret = -EIO; ret = -EIO;
goto out_put_bioc; goto out_put_bioc;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment