]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] device-mapper statistics: basic
authorKevin Corry <kevcorry@us.ibm.com>
Wed, 1 Feb 2006 11:04:52 +0000 (03:04 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 1 Feb 2006 16:53:10 +0000 (08:53 -0800)
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>
drivers/md/dm.c

index 8c16359f8b0189c5a77d6eb19106ceb21231c0ce..c47518386c917783dafbeb9f4199c51b616ccdcc 100644 (file)
@@ -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.