<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From: Kevin Corry &lt;kevcorry@us.ibm.com&gt;

Record basic I/O statistics for mapped devices.

Signed-Off-By: Kevin Corry &lt;kevcorry@us.ibm.com&gt;
Signed-Off-By: Alasdair G Kergon &lt;agk@redhat.com&gt;

Index: linux-2.6.16-rc1/drivers/md/dm.c
===================================================================
--- linux-2.6.16-rc1.orig/drivers/md/dm.c	2006-01-20 18:41:11.000000000 +0000
+++ linux-2.6.16-rc1/drivers/md/dm.c	2006-01-20 20:17:48.000000000 +0000
@@ -573,10 +573,14 @@ static void __split_bio(struct mapped_de
 static int dm_request(request_queue_t *q, struct bio *bio)
 {
 	int r;
+	int rw = bio_data_dir(bio);
 	struct mapped_device *md = q-&gt;queuedata;
 
 	down_read(&amp;md-&gt;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.
</pre></body></html>