On Sat, 23 Nov 2013 20:03:30 -0800 Kent Overstreet <kmo@xxxxxxxxxxxxx> wrote: > It was being open coded in a few places. > > Signed-off-by: Kent Overstreet <kmo@xxxxxxxxxxxxx> > Cc: Jens Axboe <axboe@xxxxxxxxx> > Cc: Joern Engel <joern@xxxxxxxxx> > Cc: Prasad Joshi <prasadjoshi.linux@xxxxxxxxx> > Cc: Neil Brown <neilb@xxxxxxx> > Cc: Chris Mason <chris.mason@xxxxxxxxxxxx> Acked-by: NeilBrown <neilb@xxxxxxx> 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:
signature.asc
Description: PGP signature