block: simplify I/O stat accounting

This simplifies I/O stat accounting switching code and separates it
completely from I/O scheduler switch code.

Requests are accounted according to the state of their request queue
at the time of the request allocation. There is no need anymore to
flush the request queue when switching I/O accounting state.

Signed-off-by: Jerome Marchand <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
This commit is contained in:
Jerome Marchand 2009-04-22 14:01:49 +02:00 • committed by Jens Axboe
commit 42dad7647a
5 changed files with 12 additions and 13 deletions

View file

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