aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/md/bitmap.c2
-rw-r--r--drivers/md/md.c8
-rw-r--r--drivers/md/md.h2
-rw-r--r--drivers/md/raid1.c12
-rw-r--r--drivers/md/raid10.c6
5 files changed, 15 insertions, 15 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 65d567373213..fdde0279755f 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -212,7 +212,7 @@ static struct page *read_sb_page(mddev_t *mddev, loff_t offset,
212 212
213 target = rdev->sb_start + offset + index * (PAGE_SIZE/512); 213 target = rdev->sb_start + offset + index * (PAGE_SIZE/512);
214 214
215 if (sync_page_io(rdev->bdev, target, 215 if (sync_page_io(rdev, target,
216 roundup(size, bdev_logical_block_size(rdev->bdev)), 216 roundup(size, bdev_logical_block_size(rdev->bdev)),
217 page, READ)) { 217 page, READ)) {
218 page->index = index; 218 page->index = index;
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 0b6fa2a1882a..3149bf33f1c5 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -721,8 +721,8 @@ static void bi_complete(struct bio *bio, int error)
721 complete((struct completion*)bio->bi_private); 721 complete((struct completion*)bio->bi_private);
722} 722}
723 723
724int sync_page_io(struct block_device *bdev, sector_t sector, int size, 724int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size,
725 struct page *page, int rw) 725 struct page *page, int rw)
726{ 726{
727 struct bio *bio = bio_alloc(GFP_NOIO, 1); 727 struct bio *bio = bio_alloc(GFP_NOIO, 1);
728 struct completion event; 728 struct completion event;
@@ -730,7 +730,7 @@ int sync_page_io(struct block_device *bdev, sector_t sector, int size,
730 730
731 rw |= REQ_SYNC | REQ_UNPLUG; 731 rw |= REQ_SYNC | REQ_UNPLUG;
732 732
733 bio->bi_bdev = bdev; 733 bio->bi_bdev = rdev->bdev;
734 bio->bi_sector = sector; 734 bio->bi_sector = sector;
735 bio_add_page(bio, page, size, 0); 735 bio_add_page(bio, page, size, 0);
736 init_completion(&event); 736 init_completion(&event);
@@ -756,7 +756,7 @@ static int read_disk_sb(mdk_rdev_t * rdev, int size)
756 return 0; 756 return 0;
757 757
758 758
759 if (!sync_page_io(rdev->bdev, rdev->sb_start, size, rdev->sb_page, READ)) 759 if (!sync_page_io(rdev, rdev->sb_start, size, rdev->sb_page, READ))
760 goto fail; 760 goto fail;
761 rdev->sb_loaded = 1; 761 rdev->sb_loaded = 1;
762 return 0; 762 return 0;
diff --git a/drivers/md/md.h b/drivers/md/md.h
index 112a2c32db0c..5ee537135553 100644
--- a/drivers/md/md.h
+++ b/drivers/md/md.h
@@ -495,7 +495,7 @@ extern void md_flush_request(mddev_t *mddev, struct bio *bio);
495extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, 495extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev,
496 sector_t sector, int size, struct page *page); 496 sector_t sector, int size, struct page *page);
497extern void md_super_wait(mddev_t *mddev); 497extern void md_super_wait(mddev_t *mddev);
498extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, 498extern int sync_page_io(mdk_rdev_t *rdev, sector_t sector, int size,
499 struct page *page, int rw); 499 struct page *page, int rw);
500extern void md_do_sync(mddev_t *mddev); 500extern void md_do_sync(mddev_t *mddev);
501extern void md_new_event(mddev_t *mddev); 501extern void md_new_event(mddev_t *mddev);
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 6cb6cae1b386..08c66afea494 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1382,7 +1382,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
1382 * active, and resync is currently active 1382 * active, and resync is currently active
1383 */ 1383 */
1384 rdev = conf->mirrors[d].rdev; 1384 rdev = conf->mirrors[d].rdev;
1385 if (sync_page_io(rdev->bdev, 1385 if (sync_page_io(rdev,
1386 sect + rdev->data_offset, 1386 sect + rdev->data_offset,
1387 s<<9, 1387 s<<9,
1388 bio->bi_io_vec[idx].bv_page, 1388 bio->bi_io_vec[idx].bv_page,
@@ -1408,7 +1408,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
1408 continue; 1408 continue;
1409 rdev = conf->mirrors[d].rdev; 1409 rdev = conf->mirrors[d].rdev;
1410 atomic_add(s, &rdev->corrected_errors); 1410 atomic_add(s, &rdev->corrected_errors);
1411 if (sync_page_io(rdev->bdev, 1411 if (sync_page_io(rdev,
1412 sect + rdev->data_offset, 1412 sect + rdev->data_offset,
1413 s<<9, 1413 s<<9,
1414 bio->bi_io_vec[idx].bv_page, 1414 bio->bi_io_vec[idx].bv_page,
@@ -1423,7 +1423,7 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
1423 if (r1_bio->bios[d]->bi_end_io != end_sync_read) 1423 if (r1_bio->bios[d]->bi_end_io != end_sync_read)
1424 continue; 1424 continue;
1425 rdev = conf->mirrors[d].rdev; 1425 rdev = conf->mirrors[d].rdev;
1426 if (sync_page_io(rdev->bdev, 1426 if (sync_page_io(rdev,
1427 sect + rdev->data_offset, 1427 sect + rdev->data_offset,
1428 s<<9, 1428 s<<9,
1429 bio->bi_io_vec[idx].bv_page, 1429 bio->bi_io_vec[idx].bv_page,
@@ -1507,7 +1507,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
1507 rdev = conf->mirrors[d].rdev; 1507 rdev = conf->mirrors[d].rdev;
1508 if (rdev && 1508 if (rdev &&
1509 test_bit(In_sync, &rdev->flags) && 1509 test_bit(In_sync, &rdev->flags) &&
1510 sync_page_io(rdev->bdev, 1510 sync_page_io(rdev,
1511 sect + rdev->data_offset, 1511 sect + rdev->data_offset,
1512 s<<9, 1512 s<<9,
1513 conf->tmppage, READ)) 1513 conf->tmppage, READ))
@@ -1533,7 +1533,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
1533 rdev = conf->mirrors[d].rdev; 1533 rdev = conf->mirrors[d].rdev;
1534 if (rdev && 1534 if (rdev &&
1535 test_bit(In_sync, &rdev->flags)) { 1535 test_bit(In_sync, &rdev->flags)) {
1536 if (sync_page_io(rdev->bdev, 1536 if (sync_page_io(rdev,
1537 sect + rdev->data_offset, 1537 sect + rdev->data_offset,
1538 s<<9, conf->tmppage, WRITE) 1538 s<<9, conf->tmppage, WRITE)
1539 == 0) 1539 == 0)
@@ -1550,7 +1550,7 @@ static void fix_read_error(conf_t *conf, int read_disk,
1550 rdev = conf->mirrors[d].rdev; 1550 rdev = conf->mirrors[d].rdev;
1551 if (rdev && 1551 if (rdev &&
1552 test_bit(In_sync, &rdev->flags)) { 1552 test_bit(In_sync, &rdev->flags)) {
1553 if (sync_page_io(rdev->bdev, 1553 if (sync_page_io(rdev,
1554 sect + rdev->data_offset, 1554 sect + rdev->data_offset,
1555 s<<9, conf->tmppage, READ) 1555 s<<9, conf->tmppage, READ)
1556 == 0) 1556 == 0)
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 6709cb255200..d54122b9927e 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -1557,7 +1557,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
1557 test_bit(In_sync, &rdev->flags)) { 1557 test_bit(In_sync, &rdev->flags)) {
1558 atomic_inc(&rdev->nr_pending); 1558 atomic_inc(&rdev->nr_pending);
1559 rcu_read_unlock(); 1559 rcu_read_unlock();
1560 success = sync_page_io(rdev->bdev, 1560 success = sync_page_io(rdev,
1561 r10_bio->devs[sl].addr + 1561 r10_bio->devs[sl].addr +
1562 sect + rdev->data_offset, 1562 sect + rdev->data_offset,
1563 s<<9, 1563 s<<9,
@@ -1596,7 +1596,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
1596 atomic_inc(&rdev->nr_pending); 1596 atomic_inc(&rdev->nr_pending);
1597 rcu_read_unlock(); 1597 rcu_read_unlock();
1598 atomic_add(s, &rdev->corrected_errors); 1598 atomic_add(s, &rdev->corrected_errors);
1599 if (sync_page_io(rdev->bdev, 1599 if (sync_page_io(rdev,
1600 r10_bio->devs[sl].addr + 1600 r10_bio->devs[sl].addr +
1601 sect + rdev->data_offset, 1601 sect + rdev->data_offset,
1602 s<<9, conf->tmppage, WRITE) 1602 s<<9, conf->tmppage, WRITE)
@@ -1633,7 +1633,7 @@ static void fix_read_error(conf_t *conf, mddev_t *mddev, r10bio_t *r10_bio)
1633 char b[BDEVNAME_SIZE]; 1633 char b[BDEVNAME_SIZE];
1634 atomic_inc(&rdev->nr_pending); 1634 atomic_inc(&rdev->nr_pending);
1635 rcu_read_unlock(); 1635 rcu_read_unlock();
1636 if (sync_page_io(rdev->bdev, 1636 if (sync_page_io(rdev,
1637 r10_bio->devs[sl].addr + 1637 r10_bio->devs[sl].addr +
1638 sect + rdev->data_offset, 1638 sect + rdev->data_offset,
1639 s<<9, conf->tmppage, 1639 s<<9, conf->tmppage,