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
Subject: Re: [PATCH 1/4] btrfs: merge btrfs_submit_bio_done to its caller
Date: Thu, 22 Nov 2018 18:18:55 +0200	[thread overview]
Message-ID: <12f41f94-b2de-ffc1-8dad-34f79e20b935@suse.com> (raw)
In-Reply-To: <8a765283a6ba9c2eb3f2a61c41d5246a984e583b.1542902890.git.dsterba@suse.com>



On 22.11.18 г. 18:16 ч., David Sterba wrote:
> There's one caller and its code is simple, we can open code it in
> run_one_async_done. The errors are passed through bio.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
> ---
>  fs/btrfs/disk-io.c | 18 +++++++++++++++++-
>  fs/btrfs/inode.c   | 23 -----------------------
>  2 files changed, 17 insertions(+), 24 deletions(-)
> 
> diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
> index feb67dfd663d..2f5c5442cf00 100644
> --- a/fs/btrfs/disk-io.c
> +++ b/fs/btrfs/disk-io.c
> @@ -764,11 +764,22 @@ static void run_one_async_start(struct btrfs_work *work)
>  		async->status = ret;
>  }
>  
> +/*
> + * In order to insert checksums into the metadata in large chunks, we wait
> + * until bio submission time.   All the pages in the bio are checksummed and
> + * sums are attached onto the ordered extent record.
> + *
> + * At IO completion time the csums attached on the ordered extent record are
> + * inserted into the tree.
> + */
>  static void run_one_async_done(struct btrfs_work *work)
>  {
>  	struct async_submit_bio *async;
> +	struct inode *inode;
> +	blk_status_t ret;
>  
>  	async = container_of(work, struct  async_submit_bio, work);
> +	inode = async->private_data;
>  
>  	/* If an error occurred we just want to clean up the bio and move on */
>  	if (async->status) {
> @@ -777,7 +788,12 @@ static void run_one_async_done(struct btrfs_work *work)
>  		return;
>  	}
>  
> -	btrfs_submit_bio_done(async->private_data, async->bio, async->mirror_num);
> +	ret = btrfs_map_bio(btrfs_sb(inode->i_sb), async->bio,
> +			async->mirror_num, 1);
> +	if (ret) {
> +		async->bio->bi_status = ret;
> +		bio_endio(async->bio);
> +	}
>  }
>  
>  static void run_one_async_free(struct btrfs_work *work)
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 9becf8543489..a88122b89f50 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -1924,29 +1924,6 @@ static blk_status_t btrfs_submit_bio_start(void *private_data, struct bio *bio,
>  	return 0;
>  }
>  
> -/*
> - * in order to insert checksums into the metadata in large chunks,
> - * we wait until bio submission time.   All the pages in the bio are
> - * checksummed and sums are attached onto the ordered extent record.
> - *
> - * At IO completion time the cums attached on the ordered extent record
> - * are inserted into the btree
> - */
> -blk_status_t btrfs_submit_bio_done(void *private_data, struct bio *bio,
> -			  int mirror_num)
> -{
> -	struct inode *inode = private_data;
> -	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
> -	blk_status_t ret;
> -
> -	ret = btrfs_map_bio(fs_info, bio, mirror_num, 1);
> -	if (ret) {
> -		bio->bi_status = ret;
> -		bio_endio(bio);
> -	}
> -	return ret;
> -}
> -
>  /*
>   * extent_io.c submission hook. This does the right thing for csum calculation
>   * on write, or reading the csums from the tree before a read.
> 

  reply	other threads:[~2018-11-22 16:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-22 16:16 [PATCH 0/4] Minor helper and struct member cleanups David Sterba
2018-11-22 16:16 ` [PATCH 1/4] btrfs: merge btrfs_submit_bio_done to its caller David Sterba
2018-11-22 16:18   ` Nikolay Borisov [this message]
2018-11-23  8:27   ` Johannes Thumshirn
2018-11-22 16:16 ` [PATCH 2/4] btrfs: replace async_cow::root with fs_info David Sterba
2018-11-22 16:19   ` Nikolay Borisov
2018-11-23  8:25   ` Johannes Thumshirn
2018-11-22 16:16 ` [PATCH 3/4] btrfs: remove redundant csum buffer in btrfs_io_bio David Sterba
2018-11-22 16:20   ` Nikolay Borisov
2018-11-23  8:23   ` Johannes Thumshirn
2018-11-22 16:16 ` [PATCH 4/4] btrfs: replace btrfs_io_bio::end_io with a simple helper David Sterba
2018-11-22 16:22   ` Nikolay Borisov
2018-11-23  8:19   ` Johannes Thumshirn

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=12f41f94-b2de-ffc1-8dad-34f79e20b935@suse.com \
    --to=nborisov@suse.com \
    --cc=dsterba@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).