aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk.h
diff options
context:
space:
mode:
authorJerome Marchand <jmarchan@redhat.com>2009-03-27 05:31:51 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-07 02:12:38 -0400
commit26308eab69aa193f7b3fb50764a64ae14544a39b (patch)
tree758f6100395a23228d042c3a9d6f7dc1922d7530 /block/blk.h
parent6c7e8cee6a9128eeb7f83c3ad1cb243f77f5cb16 (diff)
block: fix inconsistency in I/O stat accounting code
This forces in_flight to be zero when turning off or on the I/O stat accounting and stops updating I/O stats in attempt_merge() when accounting is turned off. Signed-off-by: Jerome Marchand <jmarchan@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk.h')
-rw-r--r--block/blk.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/block/blk.h b/block/blk.h
index 22043c2886c7..24fcaeeaf620 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -112,12 +112,14 @@ static inline int blk_cpu_to_group(int cpu)
112#endif 112#endif
113} 113}
114 114
115static inline int blk_do_io_stat(struct request_queue *q) 115static inline int blk_do_io_stat(struct request *rq)
116{ 116{
117 if (q) 117 struct gendisk *disk = rq->rq_disk;
118 return blk_queue_io_stat(q);
119 118
120 return 0; 119 if (!disk || !disk->queue)
120 return 0;
121
122 return blk_queue_io_stat(disk->queue) && (rq->cmd_flags & REQ_ELVPRIV);
121} 123}
122 124
123#endif 125#endif