summaryrefslogtreecommitdiffstats
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
authorKevin Corry2006-02-01 12:04:52 +0100
committerLinus Torvalds2006-02-01 17:53:10 +0100
commit12f03a49cf0ab5e8511911142d28699499a572c4 (patch)
treeba20a069dae0d695d84326189d2e608b4e841ed5 /drivers/md/dm.c
parent[PATCH] device-mapper ioctl: reduce PF_MEMALLOC usage (diff)
downloadkernel-qcow2-linux-12f03a49cf0ab5e8511911142d28699499a572c4.tar.gz
kernel-qcow2-linux-12f03a49cf0ab5e8511911142d28699499a572c4.tar.xz
kernel-qcow2-linux-12f03a49cf0ab5e8511911142d28699499a572c4.zip
[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>
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 8c16359f8b01..c47518386c91 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -573,10 +573,14 @@ static void __split_bio(struct mapped_device *md, struct bio *bio)
static int dm_request(request_queue_t *q, struct bio *bio)
{
int r;
+ int rw = bio_data_dir(bio);
struct mapped_device *md = q->queuedata;
down_read(&md->io_lock);
+ disk_stat_inc(dm_disk(md), ios[rw]);
+ disk_stat_add(dm_disk(md), sectors[rw], bio_sectors(bio));
+
/*
* If we're suspended we have to queue
* this io for later.