Read the fxxking source code
代码在 block/partition-generic.c
-
ssize_t part_stat_show(struct device *dev,
-
struct device_attribute *attr, char *buf)
-
{
-
struct hd_struct *p = dev_to_part(dev);
-
int cpu;
-
-
cpu = part_stat_lock();
-
part_round_stats(cpu, p);
-
part_stat_unlock();
-
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])),
-
part_in_flight(p),
-
jiffies_to_msecs(part_stat_read(p, io_ticks)),
-
jiffies_to_msecs(part_stat_read(p, time_in_queue)));
-
}
阅读(1892) | 评论(0) | 转发(0) |