[BLOCK] Document the READ/WRITE splitup of the disk stats
authorJens Axboe <axboe@suse.de>
Wed, 9 Nov 2005 12:38:47 +0000 (13:38 +0100)
committerJens Axboe <axboe@nelson.home.kernel.dk>
Sat, 12 Nov 2005 09:55:21 +0000 (10:55 +0100)
Use the symbolic name where appropriate and add a comment to the
disk_stats structure.

Signed-off-by: Jens Axboe <axboe@suse.de>
block/genhd.c
include/linux/genhd.h

index 54aec4a1ae13abd6bf55a1f42d42a946e6c2a4b8..f04609d553b8530e97c2d4106d0f21381763d74e 100644 (file)
@@ -391,12 +391,14 @@ static ssize_t disk_stats_read(struct gendisk * disk, char *page)
                "%8u %8u %8llu %8u "
                "%8u %8u %8u"
                "\n",
-               disk_stat_read(disk, ios[0]), disk_stat_read(disk, merges[0]),
-               (unsigned long long)disk_stat_read(disk, sectors[0]),
-               jiffies_to_msecs(disk_stat_read(disk, ticks[0])),
-               disk_stat_read(disk, ios[1]), disk_stat_read(disk, merges[1]),
-               (unsigned long long)disk_stat_read(disk, sectors[1]),
-               jiffies_to_msecs(disk_stat_read(disk, ticks[1])),
+               disk_stat_read(disk, ios[READ]),
+               disk_stat_read(disk, merges[READ]),
+               (unsigned long long)disk_stat_read(disk, sectors[READ]),
+               jiffies_to_msecs(disk_stat_read(disk, ticks[READ])),
+               disk_stat_read(disk, ios[WRITE]),
+               disk_stat_read(disk, merges[WRITE]),
+               (unsigned long long)disk_stat_read(disk, sectors[WRITE]),
+               jiffies_to_msecs(disk_stat_read(disk, ticks[WRITE])),
                disk->in_flight,
                jiffies_to_msecs(disk_stat_read(disk, io_ticks)),
                jiffies_to_msecs(disk_stat_read(disk, time_in_queue)));
index 8eeaa53a68c9fb2a669ac23d9e81abbe62815d37..eef5ccdcd7317942755af990969ca3c9c20030d2 100644 (file)
@@ -78,7 +78,7 @@ struct hd_struct {
        sector_t start_sect;
        sector_t nr_sects;
        struct kobject kobj;
-       unsigned ios[2], sectors[2];
+       unsigned ios[2], sectors[2];    /* READs and WRITEs */
        int policy, partno;
 };
 
@@ -89,7 +89,7 @@ struct hd_struct {
 #define GENHD_FL_SUPPRESS_PARTITION_INFO       32
 
 struct disk_stats {
-       unsigned sectors[2];
+       unsigned sectors[2];            /* READs and WRITEs */
        unsigned ios[2];
        unsigned merges[2];
        unsigned ticks[2];