linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Cc: fdmanana@suse.com
Subject: Re: [PATCH 1/2] btrfs: scrub: pass fs_info to scrub_setup_ctx
Date: Tue, 4 Dec 2018 17:15:59 +0200	[thread overview]
Message-ID: <223f1aa0-5b15-71a2-46d2-b9141eb2f3a2@suse.com> (raw)
In-Reply-To: <9049971b8dd554eed0b19134e0642b238792e29b.1543935982.git.dsterba@suse.com>



On 4.12.18 г. 17:11 ч., David Sterba wrote:
> We can pass fs_info directly as this is the only member of btrfs_device
> that's bing used inside scrub_setup_ctx.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>

> ---
>  fs/btrfs/scrub.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
> index bbd1b36f4918..ffcab263e057 100644
> --- a/fs/btrfs/scrub.c
> +++ b/fs/btrfs/scrub.c
> @@ -578,12 +578,11 @@ static void scrub_put_ctx(struct scrub_ctx *sctx)
>  		scrub_free_ctx(sctx);
>  }
>  
> -static noinline_for_stack
> -struct scrub_ctx *scrub_setup_ctx(struct btrfs_device *dev, int is_dev_replace)
> +static noinline_for_stack struct scrub_ctx *scrub_setup_ctx(
> +		struct btrfs_fs_info *fs_info, int is_dev_replace)
>  {
>  	struct scrub_ctx *sctx;
>  	int		i;
> -	struct btrfs_fs_info *fs_info = dev->fs_info;
>  
>  	sctx = kzalloc(sizeof(*sctx), GFP_KERNEL);
>  	if (!sctx)
> @@ -592,7 +591,7 @@ struct scrub_ctx *scrub_setup_ctx(struct btrfs_device *dev, int is_dev_replace)
>  	sctx->is_dev_replace = is_dev_replace;
>  	sctx->pages_per_rd_bio = SCRUB_PAGES_PER_RD_BIO;
>  	sctx->curr = -1;
> -	sctx->fs_info = dev->fs_info;
> +	sctx->fs_info = fs_info;
>  	for (i = 0; i < SCRUB_BIOS_PER_SCTX; ++i) {
>  		struct scrub_bio *sbio;
>  
> @@ -3878,7 +3877,7 @@ int btrfs_scrub_dev(struct btrfs_fs_info *fs_info, u64 devid, u64 start,
>  		return ret;
>  	}
>  
> -	sctx = scrub_setup_ctx(dev, is_dev_replace);
> +	sctx = scrub_setup_ctx(fs_info, is_dev_replace);
>  	if (IS_ERR(sctx)) {
>  		mutex_unlock(&fs_info->scrub_lock);
>  		mutex_unlock(&fs_info->fs_devices->device_list_mutex);
> 

  reply	other threads:[~2018-12-04 15:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 15:11 [PATCH 0/2] Scrub allocations vs reclaim fix David Sterba
2018-12-04 15:11 ` [PATCH 1/2] btrfs: scrub: pass fs_info to scrub_setup_ctx David Sterba
2018-12-04 15:15   ` Nikolay Borisov [this message]
2018-12-04 15:11 ` [PATCH 2/2] btrfs: scrub: move scrub_setup_ctx allocation out of device_list_mutex David Sterba
2018-12-04 15:22   ` Nikolay Borisov
2018-12-05  0:17     ` 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=223f1aa0-5b15-71a2-46d2-b9141eb2f3a2@suse.com \
    --to=nborisov@suse.com \
    --cc=dsterba@suse.com \
    --cc=fdmanana@suse.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;
as well as URLs for NNTP newsgroup(s).