linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Kent Overstreet <kmo@daterainc.com>
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	linux-btrfs@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Joern Engel <joern@logfs.org>,
	Prasad Joshi <prasadjoshi.linux@gmail.com>,
	Chris Mason <chris.mason@fusionio.com>
Subject: Re: [PATCH] block: submit_bio_wait() conversions
Date: Sun, 24 Nov 2013 15:24:03 +1100	[thread overview]
Message-ID: <20131124152403.2206a8cc@notabene.brown> (raw)
In-Reply-To: <1385265810-16095-1-git-send-email-kmo@daterainc.com>

[-- Attachment #1: Type: text/plain, Size: 1693 bytes --]

On Sat, 23 Nov 2013 20:03:30 -0800 Kent Overstreet <kmo@daterainc.com> wrote:

> It was being open coded in a few places.
> 
> Signed-off-by: Kent Overstreet <kmo@daterainc.com>
> Cc: Jens Axboe <axboe@kernel.dk>
> Cc: Joern Engel <joern@logfs.org>
> Cc: Prasad Joshi <prasadjoshi.linux@gmail.com>
> Cc: Neil Brown <neilb@suse.de>
> Cc: Chris Mason <chris.mason@fusionio.com>

Acked-by: NeilBrown <neilb@suse.de>

for the drivers/md/md.c bits, however...

> diff --git a/drivers/md/md.c b/drivers/md/md.c
> index b6b7a28..8700de3 100644
> --- a/drivers/md/md.c
> +++ b/drivers/md/md.c
> @@ -776,16 +776,10 @@ void md_super_wait(struct mddev *mddev)
>  	finish_wait(&mddev->sb_wait, &wq);
>  }
>  
> -static void bi_complete(struct bio *bio, int error)
> -{
> -	complete((struct completion*)bio->bi_private);
> -}
> -
>  int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
>  		 struct page *page, int rw, bool metadata_op)
>  {
>  	struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev);
> -	struct completion event;
>  	int ret;
>  
>  	rw |= REQ_SYNC;
        ^^^^^^^^^^^^^^^

you could remove this line as well, as submit_bio_wait sets this flag for us.


> @@ -801,11 +795,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
>  	else
>  		bio->bi_sector = sector + rdev->data_offset;
>  	bio_add_page(bio, page, size, 0);
> -	init_completion(&event);
> -	bio->bi_private = &event;
> -	bio->bi_end_io = bi_complete;
> -	submit_bio(rw, bio);
> -	wait_for_completion(&event);
> +	submit_bio_wait(rw, bio);
>  
>  	ret = test_bit(BIO_UPTODATE, &bio->bi_flags);
>  	bio_put(bio);

Thanks,
NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2013-11-24  4:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-24  4:03 [PATCH] block: submit_bio_wait() conversions Kent Overstreet
2013-11-24  4:24 ` NeilBrown [this message]
2013-11-24 23:33 ` Jens Axboe

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=20131124152403.2206a8cc@notabene.brown \
    --to=neilb@suse.de \
    --cc=axboe@kernel.dk \
    --cc=chris.mason@fusionio.com \
    --cc=joern@logfs.org \
    --cc=kmo@daterainc.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prasadjoshi.linux@gmail.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;
as well as URLs for NNTP newsgroup(s).