From: Kevin Corry Date: Wed, 1 Feb 2006 11:04:52 +0000 (-0800) Subject: [PATCH] device-mapper statistics: basic X-Git-Tag: v2.6.16-rc2~151 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12f03a49cf0ab5e8511911142d28699499a572c4;p=linux-2.6 [PATCH] device-mapper statistics: basic Record basic I/O statistics for mapped devices. Signed-off-by: Kevin Corry Signed-off-by: Alasdair G Kergon Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 8c16359f8b..c47518386c 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.