]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - block/blk.h
block: fix inconsistency in I/O stat accounting code
[linux-2.6-omap-h63xx.git] / block / blk.h
index 22043c2886c70acbd14ef6121cf0047b33557360..24fcaeeaf6202b1e19de9f8e57477b97bccc4065 100644 (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