diff options
author | Jerome Marchand <jmarchan@redhat.com> | 2009-03-27 05:31:51 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-04-07 02:12:38 -0400 |
commit | 26308eab69aa193f7b3fb50764a64ae14544a39b (patch) | |
tree | 758f6100395a23228d042c3a9d6f7dc1922d7530 /block/blk.h | |
parent | 6c7e8cee6a9128eeb7f83c3ad1cb243f77f5cb16 (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.h | 10 |
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 | ||
115 | static inline int blk_do_io_stat(struct request_queue *q) | 115 | static 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 |