[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20131124152403.2206a8cc@notabene.brown>
Date: Sun, 24 Nov 2013 15:24:03 +1100
From: NeilBrown <neilb@...e.de>
To: Kent Overstreet <kmo@...erainc.com>
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-btrfs@...r.kernel.org, Jens Axboe <axboe@...nel.dk>,
Joern Engel <joern@...fs.org>,
Prasad Joshi <prasadjoshi.linux@...il.com>,
Chris Mason <chris.mason@...ionio.com>
Subject: Re: [PATCH] block: submit_bio_wait() conversions
On Sat, 23 Nov 2013 20:03:30 -0800 Kent Overstreet <kmo@...erainc.com> wrote:
> It was being open coded in a few places.
>
> Signed-off-by: Kent Overstreet <kmo@...erainc.com>
> Cc: Jens Axboe <axboe@...nel.dk>
> Cc: Joern Engel <joern@...fs.org>
> Cc: Prasad Joshi <prasadjoshi.linux@...il.com>
> Cc: Neil Brown <neilb@...e.de>
> Cc: Chris Mason <chris.mason@...ionio.com>
Acked-by: NeilBrown <neilb@...e.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
Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)
Powered by blists - more mailing lists