diff options
author | ecashin@coraid.com <ecashin@coraid.com> | 2005-04-19 01:00:22 -0400 |
---|---|---|
committer | Greg KH <greg@press.kroah.org> | 2005-04-19 01:00:22 -0400 |
commit | 0c6f0e7920f39b28bdbe5f134f3e592542332d87 (patch) | |
tree | 0d31149e2c52557555d35696e13d3d9baabc1eaa /drivers/block/aoe/aoecmd.c | |
parent | e3b7df65e089f143b9228472b80fb96c495fb634 (diff) |
[PATCH] aoe 11/12: add support for disk statistics
add support for disk statistics
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/block/aoe/aoecmd.c')
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index f810bd6bf87f..60beb8db4612 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -456,6 +456,20 @@ aoecmd_ata_rsp(struct sk_buff *skb) | |||
456 | if (buf) { | 456 | if (buf) { |
457 | buf->nframesout -= 1; | 457 | buf->nframesout -= 1; |
458 | if (buf->nframesout == 0 && buf->resid == 0) { | 458 | if (buf->nframesout == 0 && buf->resid == 0) { |
459 | unsigned long duration = jiffies - buf->start_time; | ||
460 | unsigned long n_sect = buf->bio->bi_size >> 9; | ||
461 | struct gendisk *disk = d->gd; | ||
462 | |||
463 | if (bio_data_dir(buf->bio) == WRITE) { | ||
464 | disk_stat_inc(disk, writes); | ||
465 | disk_stat_add(disk, write_ticks, duration); | ||
466 | disk_stat_add(disk, write_sectors, n_sect); | ||
467 | } else { | ||
468 | disk_stat_inc(disk, reads); | ||
469 | disk_stat_add(disk, read_ticks, duration); | ||
470 | disk_stat_add(disk, read_sectors, n_sect); | ||
471 | } | ||
472 | disk_stat_add(disk, io_ticks, duration); | ||
459 | n = (buf->flags & BUFFL_FAIL) ? -EIO : 0; | 473 | n = (buf->flags & BUFFL_FAIL) ? -EIO : 0; |
460 | bio_endio(buf->bio, buf->bio->bi_size, n); | 474 | bio_endio(buf->bio, buf->bio->bi_size, n); |
461 | mempool_free(buf, d->bufpool); | 475 | mempool_free(buf, d->bufpool); |