diff options
author | Jerome Marchand <jmarchan@redhat.com> | 2008-02-08 05:04:55 -0500 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-02-08 06:41:58 -0500 |
commit | 34e8beac92c27d292938065f8375842d2840767c (patch) | |
tree | c2bedbe4901dea130ffec0a1716f4181a087e73b /fs | |
parent | a890d62b9e8743341f62548104d1ac29fa8a5a88 (diff) |
Enhanced partition statistics: sysfs
Reports enhanced partition statistics in sysfs.
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/partitions/check.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index f2ec7f1b0ec5..950bdb4b8f53 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -216,9 +216,25 @@ static ssize_t part_stat_show(struct device *dev, | |||
216 | { | 216 | { |
217 | struct hd_struct *p = dev_to_part(dev); | 217 | struct hd_struct *p = dev_to_part(dev); |
218 | 218 | ||
219 | return sprintf(buf, "%8u %8llu %8u %8llu\n", | 219 | preempt_disable(); |
220 | p->ios[0], (unsigned long long)p->sectors[0], | 220 | part_round_stats(p); |
221 | p->ios[1], (unsigned long long)p->sectors[1]); | 221 | preempt_enable(); |
222 | return sprintf(buf, | ||
223 | "%8lu %8lu %8llu %8u " | ||
224 | "%8lu %8lu %8llu %8u " | ||
225 | "%8u %8u %8u" | ||
226 | "\n", | ||
227 | part_stat_read(p, ios[READ]), | ||
228 | part_stat_read(p, merges[READ]), | ||
229 | (unsigned long long)part_stat_read(p, sectors[READ]), | ||
230 | jiffies_to_msecs(part_stat_read(p, ticks[READ])), | ||
231 | part_stat_read(p, ios[WRITE]), | ||
232 | part_stat_read(p, merges[WRITE]), | ||
233 | (unsigned long long)part_stat_read(p, sectors[WRITE]), | ||
234 | jiffies_to_msecs(part_stat_read(p, ticks[WRITE])), | ||
235 | p->in_flight, | ||
236 | jiffies_to_msecs(part_stat_read(p, io_ticks)), | ||
237 | jiffies_to_msecs(part_stat_read(p, time_in_queue))); | ||
222 | } | 238 | } |
223 | 239 | ||
224 | #ifdef CONFIG_FAIL_MAKE_REQUEST | 240 | #ifdef CONFIG_FAIL_MAKE_REQUEST |