Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Christoph Hellwig <hch@lst.de>, Chris Mason <clm@fb.com>,
	Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 5/6] btrfs: remove btrfs_map_sblock
Date: Wed, 31 May 2023 16:49:31 +0800	[thread overview]
Message-ID: <9dddd440-6842-b042-2340-3efc67d1faa2@gmx.com> (raw)
In-Reply-To: <20230531041740.375963-6-hch@lst.de>



On 2023/5/31 12:17, Christoph Hellwig wrote:
> btrfs_map_sblock just hardcodes three arguments and calls
> btrfs_map_sblock.  Remove it as it doesn't provide any real
> value, but makes following the btrfs_map_block callchains harder.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>   fs/btrfs/scrub.c   | 9 +++++----
>   fs/btrfs/volumes.c | 9 ---------
>   fs/btrfs/volumes.h | 3 ---
>   fs/btrfs/zoned.c   | 4 ++--
>   4 files changed, 7 insertions(+), 18 deletions(-)
>
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index d7d8faf1978a87..8fce48d9e07a85 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -882,8 +882,9 @@ static void scrub_stripe_report_errors(struct scrub_ctx *sctx,
>
>   		/* For scrub, our mirror_num should always start at 1. */
>   		ASSERT(stripe->mirror_num >= 1);
> -		ret = btrfs_map_sblock(fs_info, BTRFS_MAP_GET_READ_MIRRORS,
> -				       stripe->logical, &mapped_len, &bioc);
> +		ret = btrfs_map_block(fs_info, BTRFS_MAP_GET_READ_MIRRORS,
> +				      stripe->logical, &mapped_len, &bioc,
> +				      NULL, NULL, 1);
>   		/*
>   		 * If we failed, dev will be NULL, and later detailed reports
>   		 * will just be skipped.
> @@ -1893,8 +1894,8 @@ static int scrub_raid56_parity_stripe(struct scrub_ctx *sctx,
>   	bio->bi_end_io = raid56_scrub_wait_endio;
>
>   	btrfs_bio_counter_inc_blocked(fs_info);
> -	ret = btrfs_map_sblock(fs_info, BTRFS_MAP_WRITE, full_stripe_start,
> -			       &length, &bioc);
> +	ret = btrfs_map_block(fs_info, BTRFS_MAP_WRITE, full_stripe_start,
> +			      &length, &bioc, NULL, NULL, 1);
>   	if (ret < 0) {
>   		btrfs_put_bioc(bioc);
>   		btrfs_bio_counter_dec(fs_info);
> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
> index 53059ee04f9b60..6141a9fe5a28a0 100644
> --- a/fs/btrfs/volumes.c
> +++ b/fs/btrfs/volumes.c
> @@ -6481,15 +6481,6 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op,
>   	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,
>   				      const struct btrfs_fs_devices *fs_devices)
>   {
> diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
> index c70805c8d89554..3930ee01d6968f 100644
> --- a/fs/btrfs/volumes.h
> +++ b/fs/btrfs/volumes.h
> @@ -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_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,
>   		    u64 logical, u64 *length,
>   		    struct btrfs_io_context **bioc_ret,
> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
> index e311aae8f1ddca..bbde4ddd475492 100644
> --- a/fs/btrfs/zoned.c
> +++ b/fs/btrfs/zoned.c
> @@ -1782,8 +1782,8 @@ static int read_zone_info(struct btrfs_fs_info *fs_info, u64 logical,
>   	int nmirrors;
>   	int i, ret;
>
> -	ret = btrfs_map_sblock(fs_info, BTRFS_MAP_GET_READ_MIRRORS, logical,
> -			       &mapped_length, &bioc);
> +	ret = btrfs_map_block(fs_info, BTRFS_MAP_GET_READ_MIRRORS, logical,
> +			      &mapped_length, &bioc, NULL, NULL, 1);
>   	if (ret || !bioc || mapped_length < PAGE_SIZE) {
>   		ret = -EIO;
>   		goto out_put_bioc;

  reply	other threads:[~2023-05-31  8:51 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31  4:17 cleanup the btrfs_map_block interface Christoph Hellwig
2023-05-31  4:17 ` [PATCH 1/6] btrfs: remove BTRFS_MAP_DISCARD Christoph Hellwig
2023-05-31  8:45   ` Qu Wenruo
2023-05-31  4:17 ` [PATCH 2/6] btrfs: optimize simple reads in btrfsic_map_block Christoph Hellwig
2023-05-31  8:47   ` Qu Wenruo
2023-05-31 12:31     ` Johannes Thumshirn
2023-05-31 12:35       ` Christoph Hellwig
2023-05-31 12:46         ` Johannes Thumshirn
2023-05-31  4:17 ` [PATCH 3/6] btrfs: remove btrfs_map_block Christoph Hellwig
2023-05-31  8:48   ` Qu Wenruo
2023-05-31  4:17 ` [PATCH 4/6] btrfs: rename __btrfs_map_block to btrfs_map_block Christoph Hellwig
2023-05-31  8:48   ` Qu Wenruo
2023-05-31  4:17 ` [PATCH 5/6] btrfs: remove btrfs_map_sblock Christoph Hellwig
2023-05-31  8:49   ` Qu Wenruo [this message]
2023-05-31  4:17 ` [PATCH 6/6] btrfs: remove need_full_stripe Christoph Hellwig
2023-05-31  8:52   ` Qu Wenruo
2023-05-31 12:37     ` Christoph Hellwig
2023-05-31 12:35 ` cleanup the btrfs_map_block interface Johannes Thumshirn
2023-05-31 23:38 ` David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9dddd440-6842-b042-2340-3efc67d1faa2@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox