aboutsummaryrefslogtreecommitdiffstats
path: root/block/blk.h
diff options
context:
space:
mode:
authorJerome Marchand <jmarchan@redhat.com>2009-04-22 08:01:49 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-04-24 02:54:21 -0400
commit42dad7647aec49b3ad20dd0cb832b232a6ae514f (patch)
treeb70d4cb7706f2647e65426e24f078ddf14d6e139 /block/blk.h
parent097102c2d04974bdfcfa16a5f3062d499842139c (diff)
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 <jmarchan@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/blk.h')
-rw-r--r--block/blk.h7
1 files changed, 1 insertions, 6 deletions
diff --git a/block/blk.h b/block/blk.h
index 5dfc41267a08..79c85f7c9ff5 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -114,12 +114,7 @@ static inline int blk_cpu_to_group(int cpu)
114 114
115static inline int blk_do_io_stat(struct request *rq) 115static inline int blk_do_io_stat(struct request *rq)
116{ 116{
117 struct gendisk *disk = rq->rq_disk; 117 return rq->rq_disk && blk_rq_io_stat(rq);
118
119 if (!disk || !disk->queue)
120 return 0;
121
122 return blk_queue_io_stat(disk->queue) && (rq->cmd_flags & REQ_ELVPRIV);
123} 118}
124 119
125#endif 120#endif