block: submit_bio_wait() conversions

It was being open coded in a few places.

Signed-off-by: Kent Overstreet <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Joern Engel <[email protected]>
Cc: Prasad Joshi <[email protected]>
Cc: Neil Brown <[email protected]>
Cc: Chris Mason <[email protected]>
Acked-by: NeilBrown <[email protected]>
This commit is contained in:
Kent Overstreet 2013-11-23 22:33:32 -08:00
commit 33879d4512
8 changed files with 24 additions and 118 deletions

View file

@ -14,16 +14,10 @@
#define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1))
static void request_complete(struct bio *bio, int err)
{
complete((struct completion *)bio->bi_private);
}
static int sync_request(struct page *page, struct block_device *bdev, int rw)
{
struct bio bio;
struct bio_vec bio_vec;
struct completion complete;
bio_init(&bio);
bio.bi_max_vecs = 1;
@ -35,13 +29,8 @@ static int sync_request(struct page *page, struct block_device *bdev, int rw)
bio.bi_size = PAGE_SIZE;
bio.bi_bdev = bdev;
bio.bi_sector = page->index * (PAGE_SIZE >> 9);
init_completion(&complete);
bio.bi_private = &complete;
bio.bi_end_io = request_complete;
submit_bio(rw, &bio);
wait_for_completion(&complete);
return test_bit(BIO_UPTODATE, &bio.bi_flags) ? 0 : -EIO;
return submit_bio_wait(rw, &bio);
}
static int bdev_readpage(void *_sb, struct page *page)