summaryrefslogtreecommitdiff
path: root/block/blk.h
diff options
context:
space:
mode:
authorJerome Marchand <jmarchan@redhat.com>2009-03-27 10:31:51 +0100
committerJens Axboe <jens.axboe@oracle.com>2009-04-07 08:12:38 +0200
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)
#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