Enhanced partition statistics: sysfs

Reports enhanced partition statistics in sysfs.

Signed-off-by: Jerome Marchand <jmarchan@redhat.com>

authored by Jerome Marchand and committed by Jens Axboe 34e8beac a890d62b

+19 -3
+19 -3
fs/partitions/check.c
··· 216 { 217 struct hd_struct *p = dev_to_part(dev); 218 219 - return sprintf(buf, "%8u %8llu %8u %8llu\n", 220 - p->ios[0], (unsigned long long)p->sectors[0], 221 - p->ios[1], (unsigned long long)p->sectors[1]); 222 } 223 224 #ifdef CONFIG_FAIL_MAKE_REQUEST
··· 216 { 217 struct hd_struct *p = dev_to_part(dev); 218 219 + preempt_disable(); 220 + part_round_stats(p); 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))); 238 } 239 240 #ifdef CONFIG_FAIL_MAKE_REQUEST