block: submit_bio_wait() conversions
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>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user