diff options
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r-- | drivers/md/md.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c index e60cebf3f519..21f4d7ff0da2 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -776,16 +776,10 @@ void md_super_wait(struct mddev *mddev) | |||
776 | finish_wait(&mddev->sb_wait, &wq); | 776 | finish_wait(&mddev->sb_wait, &wq); |
777 | } | 777 | } |
778 | 778 | ||
779 | static void bi_complete(struct bio *bio, int error) | ||
780 | { | ||
781 | complete((struct completion*)bio->bi_private); | ||
782 | } | ||
783 | |||
784 | int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, | 779 | int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, |
785 | struct page *page, int rw, bool metadata_op) | 780 | struct page *page, int rw, bool metadata_op) |
786 | { | 781 | { |
787 | struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev); | 782 | struct bio *bio = bio_alloc_mddev(GFP_NOIO, 1, rdev->mddev); |
788 | struct completion event; | ||
789 | int ret; | 783 | int ret; |
790 | 784 | ||
791 | rw |= REQ_SYNC; | 785 | rw |= REQ_SYNC; |
@@ -801,11 +795,7 @@ int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, | |||
801 | else | 795 | else |
802 | bio->bi_sector = sector + rdev->data_offset; | 796 | bio->bi_sector = sector + rdev->data_offset; |
803 | bio_add_page(bio, page, size, 0); | 797 | bio_add_page(bio, page, size, 0); |
804 | init_completion(&event); | 798 | submit_bio_wait(rw, bio); |
805 | bio->bi_private = &event; | ||
806 | bio->bi_end_io = bi_complete; | ||
807 | submit_bio(rw, bio); | ||
808 | wait_for_completion(&event); | ||
809 | 799 | ||
810 | ret = test_bit(BIO_UPTODATE, &bio->bi_flags); | 800 | ret = test_bit(BIO_UPTODATE, &bio->bi_flags); |
811 | bio_put(bio); | 801 | bio_put(bio); |