Commit 34e8beac authored by Jerome Marchand's avatar Jerome Marchand Committed by Jens Axboe

Enhanced partition statistics: sysfs

Reports enhanced partition statistics in sysfs.
Signed-off-by: default avatarJerome Marchand <jmarchan@redhat.com>
parent a890d62b
...@@ -216,9 +216,25 @@ static ssize_t part_stat_show(struct device *dev, ...@@ -216,9 +216,25 @@ static ssize_t part_stat_show(struct device *dev,
{ {
struct hd_struct *p = dev_to_part(dev); struct hd_struct *p = dev_to_part(dev);
return sprintf(buf, "%8u %8llu %8u %8llu\n", preempt_disable();
p->ios[0], (unsigned long long)p->sectors[0], part_round_stats(p);
p->ios[1], (unsigned long long)p->sectors[1]); preempt_enable();
return sprintf(buf,
"%8lu %8lu %8llu %8u "
"%8lu %8lu %8llu %8u "
"%8u %8u %8u"
"\n",
part_stat_read(p, ios[READ]),
part_stat_read(p, merges[READ]),
(unsigned long long)part_stat_read(p, sectors[READ]),
jiffies_to_msecs(part_stat_read(p, ticks[READ])),
part_stat_read(p, ios[WRITE]),
part_stat_read(p, merges[WRITE]),
(unsigned long long)part_stat_read(p, sectors[WRITE]),
jiffies_to_msecs(part_stat_read(p, ticks[WRITE])),
p->in_flight,
jiffies_to_msecs(part_stat_read(p, io_ticks)),
jiffies_to_msecs(part_stat_read(p, time_in_queue)));
} }
#ifdef CONFIG_FAIL_MAKE_REQUEST #ifdef CONFIG_FAIL_MAKE_REQUEST
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment