diff options
author | Jens Axboe <axboe@suse.de> | 2005-11-01 03:26:16 -0500 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2005-11-01 03:26:16 -0500 |
commit | a362357b6cd62643d4dda3b152639303d78473da (patch) | |
tree | fe4ce823e638ded151edcb142f28a240860f0d33 /drivers/md/linear.c | |
parent | d72d904a5367ad4ca3f2c9a2ce8c3a68f0b28bf0 (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/linear.c')
-rw-r--r-- | drivers/md/linear.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index bb279fad2fd2..946efef3a8f5 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -271,6 +271,7 @@ static int linear_stop (mddev_t *mddev) | |||
271 | 271 | ||
272 | static int linear_make_request (request_queue_t *q, struct bio *bio) | 272 | static int linear_make_request (request_queue_t *q, struct bio *bio) |
273 | { | 273 | { |
274 | const int rw = bio_data_dir(bio); | ||
274 | mddev_t *mddev = q->queuedata; | 275 | mddev_t *mddev = q->queuedata; |
275 | dev_info_t *tmp_dev; | 276 | dev_info_t *tmp_dev; |
276 | sector_t block; | 277 | sector_t block; |
@@ -280,13 +281,8 @@ static int linear_make_request (request_queue_t *q, struct bio *bio) | |||
280 | return 0; | 281 | return 0; |
281 | } | 282 | } |
282 | 283 | ||
283 | if (bio_data_dir(bio)==WRITE) { | 284 | disk_stat_inc(mddev->gendisk, ios[rw]); |
284 | disk_stat_inc(mddev->gendisk, writes); | 285 | disk_stat_add(mddev->gendisk, sectors[rw], bio_sectors(bio)); |
285 | disk_stat_add(mddev->gendisk, write_sectors, bio_sectors(bio)); | ||
286 | } else { | ||
287 | disk_stat_inc(mddev->gendisk, reads); | ||
288 | disk_stat_add(mddev->gendisk, read_sectors, bio_sectors(bio)); | ||
289 | } | ||
290 | 286 | ||
291 | tmp_dev = which_dev(mddev, bio->bi_sector); | 287 | tmp_dev = which_dev(mddev, bio->bi_sector); |
292 | block = bio->bi_sector >> 1; | 288 | block = bio->bi_sector >> 1; |