aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid0.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-11-01 03:26:16 -0500
committerJens Axboe <axboe@suse.de>2005-11-01 03:26:16 -0500
commita362357b6cd62643d4dda3b152639303d78473da (patch)
treefe4ce823e638ded151edcb142f28a240860f0d33 /drivers/md/raid0.c
parentd72d904a5367ad4ca3f2c9a2ce8c3a68f0b28bf0 (diff)
[BLOCK] Unify the seperate read/write io stat fields into arrays
Instead of having ->read_sectors and ->write_sectors, combine the two into ->sectors[2] and similar for the other fields. This saves a branch several places in the io path, since we don't have to care for what the actual io direction is. On my x86-64 box, that's 200 bytes less text in just the core (not counting the various drivers). Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r--drivers/md/raid0.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index f6757259ce7f..fece3277c2a5 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -403,19 +403,15 @@ static int raid0_make_request (request_queue_t *q, struct bio *bio)
403 mdk_rdev_t *tmp_dev; 403 mdk_rdev_t *tmp_dev;
404 unsigned long chunk; 404 unsigned long chunk;
405 sector_t block, rsect; 405 sector_t block, rsect;
406 const int rw = bio_data_dir(bio);
406 407
407 if (unlikely(bio_barrier(bio))) { 408 if (unlikely(bio_barrier(bio))) {
408 bio_endio(bio, bio->bi_size, -EOPNOTSUPP); 409 bio_endio(bio, bio->bi_size, -EOPNOTSUPP);
409 return 0; 410 return 0;
410 } 411 }
411 412
412 if (bio_data_dir(bio)==WRITE) { 413 disk_stat_inc(mddev->gendisk, ios[rw]);
413 disk_stat_inc(mddev->gendisk, writes); 414 disk_stat_add(mddev->gendisk, sectors[rw], bio_sectors(bio));
414 disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio));
415 } else {
416 disk_stat_inc(mddev->gendisk, reads);
417 disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bio));
418 }
419 415
420 chunk_size = mddev->chunk_size >> 10; 416 chunk_size = mddev->chunk_size >> 10;
421 chunk_sects = mddev->chunk_size >> 9; 417 chunk_sects = mddev->chunk_size >> 9;