aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r--drivers/md/raid1.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 0e1f148dd41d..e16f473bcf46 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -647,6 +647,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
647 unsigned long flags; 647 unsigned long flags;
648 struct bio_list bl; 648 struct bio_list bl;
649 struct page **behind_pages = NULL; 649 struct page **behind_pages = NULL;
650 const int rw = bio_data_dir(bio);
650 651
651 if (unlikely(bio_barrier(bio))) { 652 if (unlikely(bio_barrier(bio))) {
652 bio_endio(bio, bio->bi_size, -EOPNOTSUPP); 653 bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
@@ -665,13 +666,8 @@ static int make_request(request_queue_t *q, struct bio * bio)
665 conf->nr_pending++; 666 conf->nr_pending++;
666 spin_unlock_irq(&conf->resync_lock); 667 spin_unlock_irq(&conf->resync_lock);
667 668
668 if (bio_data_dir(bio)==WRITE) { 669 disk_stat_inc(mddev->gendisk, ios[rw]);
669 disk_stat_inc(mddev->gendisk, writes); 670 disk_stat_add(mddev->gendisk, sectors[rw], bio_sectors(bio));
670 disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio));
671 } else {
672 disk_stat_inc(mddev->gendisk, reads);
673 disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bio));
674 }
675 671
676 /* 672 /*
677 * make_request() can abort the operation when READA is being 673 * make_request() can abort the operation when READA is being
@@ -686,7 +682,7 @@ static int make_request(request_queue_t *q, struct bio * bio)
686 r1_bio->mddev = mddev; 682 r1_bio->mddev = mddev;
687 r1_bio->sector = bio->bi_sector; 683 r1_bio->sector = bio->bi_sector;
688 684
689 if (bio_data_dir(bio) == READ) { 685 if (rw == READ) {
690 /* 686 /*
691 * read balancing logic: 687 * read balancing logic:
692 */ 688 */