aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2011-01-13 17:14:33 -0500
committerNeilBrown <neilb@suse.de>2011-01-13 17:14:33 -0500
commitccebd4c4159462c96397ae9af9c667bb394d7b70 (patch)
tree04554f0e7607d906c6b09f31a995fca0dd40c5b5 /drivers/md/raid1.c
parent57b2caa394393f8870ed41bdcc38a7542593018f (diff)
md-new-param-to_sync_page_io
Add new parameter to 'sync_page_io'. The new parameter allows us to distinguish between metadata and data operations. This becomes important later when we add the ability to use separate devices for data and metadata. Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index d50056ba596b..a23ffa397ba9 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -1365,10 +1365,10 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
1365 */ 1365 */
1366 rdev = conf->mirrors[d].rdev; 1366 rdev = conf->mirrors[d].rdev;
1367 if (sync_page_io(rdev, 1367 if (sync_page_io(rdev,
1368 sect + rdev->data_offset, 1368 sect,
1369 s<<9, 1369 s<<9,
1370 bio->bi_io_vec[idx].bv_page, 1370 bio->bi_io_vec[idx].bv_page,
1371 READ)) { 1371 READ, false)) {
1372 success = 1; 1372 success = 1;
1373 break; 1373 break;
1374 } 1374 }
@@ -1391,10 +1391,10 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
1391 rdev = conf->mirrors[d].rdev; 1391 rdev = conf->mirrors[d].rdev;
1392 atomic_add(s, &rdev->corrected_errors); 1392 atomic_add(s, &rdev->corrected_errors);
1393 if (sync_page_io(rdev, 1393 if (sync_page_io(rdev,
1394 sect + rdev->data_offset, 1394 sect,
1395 s<<9, 1395 s<<9,
1396 bio->bi_io_vec[idx].bv_page, 1396 bio->bi_io_vec[idx].bv_page,
1397 WRITE) == 0) 1397 WRITE, false) == 0)
1398 md_error(mddev, rdev); 1398 md_error(mddev, rdev);
1399 } 1399 }
1400 d = start; 1400 d = start;
@@ -1406,10 +1406,10 @@ static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio)
1406 continue; 1406 continue;
1407 rdev = conf->mirrors[d].rdev; 1407 rdev = conf->mirrors[d].rdev;
1408 if (sync_page_io(rdev, 1408 if (sync_page_io(rdev,
1409 sect + rdev->data_offset, 1409 sect,
1410 s<<9, 1410 s<<9,
1411 bio->bi_io_vec[idx].bv_page, 1411 bio->bi_io_vec[idx].bv_page,
1412 READ) == 0) 1412 READ, false) == 0)
1413 md_error(mddev, rdev); 1413 md_error(mddev, rdev);
1414 } 1414 }
1415 } else { 1415 } else {
@@ -1489,10 +1489,8 @@ static void fix_read_error(conf_t *conf, int read_disk,
1489 rdev = conf->mirrors[d].rdev; 1489 rdev = conf->mirrors[d].rdev;
1490 if (rdev && 1490 if (rdev &&
1491 test_bit(In_sync, &rdev->flags) && 1491 test_bit(In_sync, &rdev->flags) &&
1492 sync_page_io(rdev, 1492 sync_page_io(rdev, sect, s<<9,
1493 sect + rdev->data_offset, 1493 conf->tmppage, READ, false))
1494 s<<9,
1495 conf->tmppage, READ))
1496 success = 1; 1494 success = 1;
1497 else { 1495 else {
1498 d++; 1496 d++;
@@ -1515,9 +1513,8 @@ static void fix_read_error(conf_t *conf, int read_disk,
1515 rdev = conf->mirrors[d].rdev; 1513 rdev = conf->mirrors[d].rdev;
1516 if (rdev && 1514 if (rdev &&
1517 test_bit(In_sync, &rdev->flags)) { 1515 test_bit(In_sync, &rdev->flags)) {
1518 if (sync_page_io(rdev, 1516 if (sync_page_io(rdev, sect, s<<9,
1519 sect + rdev->data_offset, 1517 conf->tmppage, WRITE, false)
1520 s<<9, conf->tmppage, WRITE)
1521 == 0) 1518 == 0)
1522 /* Well, this device is dead */ 1519 /* Well, this device is dead */
1523 md_error(mddev, rdev); 1520 md_error(mddev, rdev);
@@ -1532,9 +1529,8 @@ static void fix_read_error(conf_t *conf, int read_disk,
1532 rdev = conf->mirrors[d].rdev; 1529 rdev = conf->mirrors[d].rdev;
1533 if (rdev && 1530 if (rdev &&
1534 test_bit(In_sync, &rdev->flags)) { 1531 test_bit(In_sync, &rdev->flags)) {
1535 if (sync_page_io(rdev, 1532 if (sync_page_io(rdev, sect, s<<9,
1536 sect + rdev->data_offset, 1533 conf->tmppage, READ, false)
1537 s<<9, conf->tmppage, READ)
1538 == 0) 1534 == 0)
1539 /* Well, this device is dead */ 1535 /* Well, this device is dead */
1540 md_error(mddev, rdev); 1536 md_error(mddev, rdev);