Commit 12f03a49cf0ab5e8511911142d28699499a572c4
Committed by
Linus Torvalds
1 parent
dab6a42915
Exists in
master
and in
4 other branches
[PATCH] device-mapper statistics: basic
Record basic I/O statistics for mapped devices. Signed-off-by: Kevin Corry <kevcorry@us.ibm.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing 1 changed file with 4 additions and 0 deletions Side-by-side Diff
drivers/md/dm.c
| ... | ... | @@ -573,9 +573,13 @@ |
| 573 | 573 | static int dm_request(request_queue_t *q, struct bio *bio) |
| 574 | 574 | { |
| 575 | 575 | int r; |
| 576 | + int rw = bio_data_dir(bio); | |
| 576 | 577 | struct mapped_device *md = q->queuedata; |
| 577 | 578 | |
| 578 | 579 | down_read(&md->io_lock); |
| 580 | + | |
| 581 | + disk_stat_inc(dm_disk(md), ios[rw]); | |
| 582 | + disk_stat_add(dm_disk(md), sectors[rw], bio_sectors(bio)); | |
| 579 | 583 | |
| 580 | 584 | /* |
| 581 | 585 | * If we're suspended we have to queue |