public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3 1/3] btrfs: scrub: rename members related to scrub_block::pagev
Date: Mon, 14 Mar 2022 14:22:13 +0100	[thread overview]
Message-ID: <20220314132213.GJ12643@twin.jikos.cz> (raw)
In-Reply-To: <c9b166e536844ca1dd42adb8ea1e3520fc53618a.1647161284.git.wqu@suse.com>

On Sun, Mar 13, 2022 at 06:40:00PM +0800, Qu Wenruo wrote:
> The following will be renamed in this patch:
> 
> - scrub_block::pagev -> sectorv

			  sectors
> 
> - scrub_block::page_count -> sector_count
> 
> - SCRUB_MAX_PAGES_PER_BLOCK -> SCRUB_MAX_SECTORS_PER_BLOCK
> 
> - page_num -> sector_num to iterate scrub_block::sectorv

						 ::sectors
> 
> For now scrub_page is not yet renamed, as the current changeset is
> already large enough.
> 
> The rename for scrub_page will come in a separate patch.
> 
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
>  fs/btrfs/scrub.c | 221 +++++++++++++++++++++++------------------------
>  1 file changed, 110 insertions(+), 111 deletions(-)

> @@ -2193,8 +2192,8 @@ static void scrub_missing_raid56_pages(struct scrub_block *sblock)
>  {
>  	struct scrub_ctx *sctx = sblock->sctx;
>  	struct btrfs_fs_info *fs_info = sctx->fs_info;
> -	u64 length = sblock->page_count * PAGE_SIZE;
> -	u64 logical = sblock->pagev[0]->logical;
> +	u64 length = sblock->sector_count * fs_info->sectorsize;

This should have been also converted to << sectorsize_bits

> +	u64 logical = sblock->sectors[0]->logical;
>  	struct btrfs_io_context *bioc = NULL;
>  	struct bio *bio;
>  	struct btrfs_raid_bio *rbio;
> @@ -4058,18 +4057,18 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
>  	}
>  
>  	if (fs_info->nodesize >
> -	    PAGE_SIZE * SCRUB_MAX_PAGES_PER_BLOCK ||
> -	    fs_info->sectorsize > PAGE_SIZE * SCRUB_MAX_PAGES_PER_BLOCK) {
> +	    SCRUB_MAX_SECTORS_PER_BLOCK * fs_info->sectorsize ||

And here.

> +	    fs_info->sectorsize > PAGE_SIZE * SCRUB_MAX_SECTORS_PER_BLOCK) {
>  		/*
>  		 * would exhaust the array bounds of pagev member in
>  		 * struct scrub_block
>  		 */
>  		btrfs_err(fs_info,
> -			  "scrub: size assumption nodesize and sectorsize <= SCRUB_MAX_PAGES_PER_BLOCK (%d <= %d && %d <= %d) fails",
> +			  "scrub: size assumption nodesize and sectorsize <= SCRUB_MAX_SECTORS_PER_BLOCK (%d <= %d && %d <= %d) fails",
>  		       fs_info->nodesize,
> -		       SCRUB_MAX_PAGES_PER_BLOCK,
> +		       SCRUB_MAX_SECTORS_PER_BLOCK,
>  		       fs_info->sectorsize,
> -		       SCRUB_MAX_PAGES_PER_BLOCK);
> +		       SCRUB_MAX_SECTORS_PER_BLOCK);
>  		return -EINVAL;
>  	}
>  
> -- 
> 2.35.1

  reply	other threads:[~2022-03-14 13:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-13 10:39 [PATCH v3 0/3] btrfs: scrub: big renaming to address the page and sector difference Qu Wenruo
2022-03-13 10:40 ` [PATCH v3 1/3] btrfs: scrub: rename members related to scrub_block::pagev Qu Wenruo
2022-03-14 13:22   ` David Sterba [this message]
2022-03-13 10:40 ` [PATCH v3 2/3] btrfs: scrub: rename scrub_page to scrub_sector Qu Wenruo
2022-03-13 10:40 ` [PATCH v3 3/3] btrfs: scrub: rename scrub_bio::pagev[] and related members Qu Wenruo
2022-03-14 13:36 ` [PATCH v3 0/3] btrfs: scrub: big renaming to address the page and sector difference 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=20220314132213.GJ12643@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /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