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 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Jerome Marchand 2009-03-27 10:31:51 +01:00 • committed by Jens Axboe
commit 26308eab69
6 changed files with 33 additions and 26 deletions

View file

@ -112,12 +112,14 @@ static inline int blk_cpu_to_group(int cpu)
#endif
}
static inline int blk_do_io_stat(struct request_queue *q)
static inline int blk_do_io_stat(struct request *rq)
{
if (q)
return blk_queue_io_stat(q);
struct gendisk *disk = rq->rq_disk;
return 0;
if (!disk || !disk->queue)
return 0;
return blk_queue_io_stat(disk->queue) && (rq->cmd_flags & REQ_ELVPRIV);
}
#endif