Skip to content

Commit

Permalink
[BLOCK] Document the READ/WRITE splitup of the disk stats
Browse files Browse the repository at this point in the history
Use the symbolic name where appropriate and add a comment to the
disk_stats structure.

Signed-off-by: Jens Axboe <axboe@suse.de>
  • Loading branch information
Jens Axboe authored and Jens Axboe committed Nov 12, 2005
1 parent cff3ba2 commit 47a0041
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
14 changes: 8 additions & 6 deletions block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
4 changes: 2 additions & 2 deletions include/linux/genhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand All @@ -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];
Expand Down

0 comments on commit 47a0041

Please sign in to comment.