Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=34e8beac92c27d292938065f8375842d2840767c
Commit:     34e8beac92c27d292938065f8375842d2840767c
Parent:     a890d62b9e8743341f62548104d1ac29fa8a5a88
Author:     Jerome Marchand <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 8 11:04:55 2008 +0100
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Fri Feb 8 12:41:58 2008 +0100

    Enhanced partition statistics: sysfs
    
    Reports enhanced partition statistics in sysfs.
    
    Signed-off-by: Jerome Marchand <[EMAIL PROTECTED]>
---
 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 f2ec7f1..950bdb4 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -216,9 +216,25 @@ static ssize_t part_stat_show(struct device *dev,
 {
        struct hd_struct *p = dev_to_part(dev);
 
-       return sprintf(buf, "%8u %8llu %8u %8llu\n",
-                      p->ios[0], (unsigned long long)p->sectors[0],
-                      p->ios[1], (unsigned long long)p->sectors[1]);
+       preempt_disable();
+       part_round_stats(p);
+       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
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to