mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
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:
parent
6ce4eac1f6
commit
33879d4512
8 changed files with 24 additions and 118 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue