diff options
Diffstat (limited to 'fs/logfs/dev_bdev.c')
| -rw-r--r-- | fs/logfs/dev_bdev.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/fs/logfs/dev_bdev.c b/fs/logfs/dev_bdev.c index 550475ca6a0e..0f95f0d0b313 100644 --- a/fs/logfs/dev_bdev.c +++ b/fs/logfs/dev_bdev.c | |||
| @@ -14,16 +14,10 @@ | |||
| 14 | 14 | ||
| 15 | #define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1)) | 15 | #define PAGE_OFS(ofs) ((ofs) & (PAGE_SIZE-1)) |
| 16 | 16 | ||
| 17 | static void request_complete(struct bio *bio, int err) | ||
| 18 | { | ||
| 19 | complete((struct completion *)bio->bi_private); | ||
| 20 | } | ||
| 21 | |||
| 22 | static int sync_request(struct page *page, struct block_device *bdev, int rw) | 17 | static int sync_request(struct page *page, struct block_device *bdev, int rw) |
| 23 | { | 18 | { |
| 24 | struct bio bio; | 19 | struct bio bio; |
| 25 | struct bio_vec bio_vec; | 20 | struct bio_vec bio_vec; |
| 26 | struct completion complete; | ||
| 27 | 21 | ||
| 28 | bio_init(&bio); | 22 | bio_init(&bio); |
| 29 | bio.bi_max_vecs = 1; | 23 | bio.bi_max_vecs = 1; |
| @@ -35,13 +29,8 @@ static int sync_request(struct page *page, struct block_device *bdev, int rw) | |||
| 35 | bio.bi_size = PAGE_SIZE; | 29 | bio.bi_size = PAGE_SIZE; |
| 36 | bio.bi_bdev = bdev; | 30 | bio.bi_bdev = bdev; |
| 37 | bio.bi_sector = page->index * (PAGE_SIZE >> 9); | 31 | bio.bi_sector = page->index * (PAGE_SIZE >> 9); |
| 38 | init_completion(&complete); | ||
| 39 | bio.bi_private = &complete; | ||
| 40 | bio.bi_end_io = request_complete; | ||
| 41 | 32 | ||
| 42 | submit_bio(rw, &bio); | 33 | return submit_bio_wait(rw, &bio); |
| 43 | wait_for_completion(&complete); | ||
| 44 | return test_bit(BIO_UPTODATE, &bio.bi_flags) ? 0 : -EIO; | ||
| 45 | } | 34 | } |
| 46 | 35 | ||
| 47 | static int bdev_readpage(void *_sb, struct page *page) | 36 | static int bdev_readpage(void *_sb, struct page *page) |
