[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    [FIX] /proc/stat for cpqarray
From:       Rolf Fokkens <rolf () flits102-126 ! flits ! rug ! nl>
Date:       2000-03-31 19:41:03
[Download RAW message or body]

Some statistics logging tools (like atsar) use /proc/stat to monitor disk I/O.
For Compaq Smart controllers this doesn't work, 'cause the controller is
forgotten in drivers/block/ll_rw_blk.c. The attached patch takes care of it.

I tested it on a SA3200 and a SA221. 

["cpq-acct.patch" (text/x-c)]

--- ../new/linux-2.2.15pre16/drivers/block/ll_rw_blk.c	Thu Mar 30 22:31:26 2000
+++ linux-2.2.15pre16cpq/drivers/block/ll_rw_blk.c	Thu Mar 30 22:29:22 2000
@@ -313,25 +313,31 @@
 	switch (major) {
 		case DAC960_MAJOR+0:
 			disk_index = (minor & 0x00f8) >> 3;
-			if (disk_index < 4)
-				drive_stat_acct(req->cmd, req->nr_sectors, disk_index);
 			break;
 		case SCSI_DISK0_MAJOR:
+		case COMPAQ_SMART2_MAJOR:
+		case COMPAQ_SMART2_MAJOR1:
+		case COMPAQ_SMART2_MAJOR2:
+		case COMPAQ_SMART2_MAJOR3:
+		case COMPAQ_SMART2_MAJOR4:
+		case COMPAQ_SMART2_MAJOR5:
+		case COMPAQ_SMART2_MAJOR6:
+		case COMPAQ_SMART2_MAJOR7:
 			disk_index = (minor & 0x00f0) >> 4;
-			if (disk_index < 4)
-				drive_stat_acct(req->cmd, req->nr_sectors, disk_index);
 			break;
 		case IDE0_MAJOR:	/* same as HD_MAJOR */
 		case XT_DISK_MAJOR:
 			disk_index = (minor & 0x0040) >> 6;
-			drive_stat_acct(req->cmd, req->nr_sectors, disk_index);
 			break;
 		case IDE1_MAJOR:
 			disk_index = ((minor & 0x0040) >> 6) + 2;
-			drive_stat_acct(req->cmd, req->nr_sectors, disk_index);
+			break;
 		default:
+			disk_index = -1;
 			break;
 	}
+	if (disk_index >= 0 && disk_index < 4)
+		drive_stat_acct(req->cmd, req->nr_sectors, disk_index);
 
 	req->next = NULL;
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic