aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/ll_rw_blk.c
diff options
context:
space:
mode:
authorChen, Kenneth W <kenneth.w.chen@intel.com>2005-10-13 15:48:42 -0400
committerJens Axboe <axboe@nelson.home.kernel.dk>2005-10-28 02:15:30 -0400
commit20e5c81fcff89535dced2ed71cf24c6c648ff40e (patch)
treec19edf4ce636f0e4713e39dd918c7d3772cda64a /drivers/block/ll_rw_blk.c
parent741b2252a5e14d6c60a913c77a6099abe73a854a (diff)
[patch] remove gendisk->stamp_idle field
struct gendisk has these two fields: stamp, stamp_idle. Update to stamp_idle is always in sync with stamp and they are always the same. Therefore, it does not add any value in having two fields tracking same timestamp. Suggest to remove it. Also, we should only update gendisk stats with non-zero value. Advantage is that we don't have to needlessly calculate memory address, and then add zero to the content. Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'drivers/block/ll_rw_blk.c')
-rw-r--r--drivers/block/ll_rw_blk.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c
index baedac522945..c42071fd2e95 100644
--- a/drivers/block/ll_rw_blk.c
+++ b/drivers/block/ll_rw_blk.c
@@ -2433,13 +2433,12 @@ void disk_round_stats(struct gendisk *disk)
2433{ 2433{
2434 unsigned long now = jiffies; 2434 unsigned long now = jiffies;
2435 2435
2436 __disk_stat_add(disk, time_in_queue, 2436 if (disk->in_flight) {
2437 disk->in_flight * (now - disk->stamp)); 2437 __disk_stat_add(disk, time_in_queue,
2438 disk->in_flight * (now - disk->stamp));
2439 __disk_stat_add(disk, io_ticks, (now - disk->stamp));
2440 }
2438 disk->stamp = now; 2441 disk->stamp = now;
2439
2440 if (disk->in_flight)
2441 __disk_stat_add(disk, io_ticks, (now - disk->stamp_idle));
2442 disk->stamp_idle = now;
2443} 2442}
2444 2443
2445/* 2444/*