diff options
Diffstat (limited to 'drivers/md/raid10.c')
-rw-r--r-- | drivers/md/raid10.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index 28dd028415e4..bbe40e9cf923 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -668,6 +668,7 @@ static int make_request(request_queue_t *q, struct bio * bio) | |||
668 | struct bio *read_bio; | 668 | struct bio *read_bio; |
669 | int i; | 669 | int i; |
670 | int chunk_sects = conf->chunk_mask + 1; | 670 | int chunk_sects = conf->chunk_mask + 1; |
671 | const int rw = bio_data_dir(bio); | ||
671 | 672 | ||
672 | if (unlikely(bio_barrier(bio))) { | 673 | if (unlikely(bio_barrier(bio))) { |
673 | bio_endio(bio, bio->bi_size, -EOPNOTSUPP); | 674 | bio_endio(bio, bio->bi_size, -EOPNOTSUPP); |
@@ -718,13 +719,8 @@ static int make_request(request_queue_t *q, struct bio * bio) | |||
718 | conf->nr_pending++; | 719 | conf->nr_pending++; |
719 | spin_unlock_irq(&conf->resync_lock); | 720 | spin_unlock_irq(&conf->resync_lock); |
720 | 721 | ||
721 | if (bio_data_dir(bio)==WRITE) { | 722 | disk_stat_inc(mddev->gendisk, ios[rw]); |
722 | disk_stat_inc(mddev->gendisk, writes); | 723 | disk_stat_add(mddev->gendisk, sectors[rw], bio_sectors(bio)); |
723 | disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio)); | ||
724 | } else { | ||
725 | disk_stat_inc(mddev->gendisk, reads); | ||
726 | disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bio)); | ||
727 | } | ||
728 | 724 | ||
729 | r10_bio = mempool_alloc(conf->r10bio_pool, GFP_NOIO); | 725 | r10_bio = mempool_alloc(conf->r10bio_pool, GFP_NOIO); |
730 | 726 | ||
@@ -734,7 +730,7 @@ static int make_request(request_queue_t *q, struct bio * bio) | |||
734 | r10_bio->mddev = mddev; | 730 | r10_bio->mddev = mddev; |
735 | r10_bio->sector = bio->bi_sector; | 731 | r10_bio->sector = bio->bi_sector; |
736 | 732 | ||
737 | if (bio_data_dir(bio) == READ) { | 733 | if (rw == READ) { |
738 | /* | 734 | /* |
739 | * read balancing logic: | 735 | * read balancing logic: |
740 | */ | 736 | */ |