Some initial probe requests don't have disk->queue mapped yet, so we
can't rely on a non-NULL queue in blk_queue_io_stat(). Wrap it in
blk_do_io_stat().
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
int rw = rq_data_dir(rq);
int cpu;
- if (!blk_fs_request(rq) || !disk || !blk_queue_io_stat(disk->queue))
+ if (!blk_fs_request(rq) || !disk || !blk_do_io_stat(disk->queue))
return;
cpu = part_stat_lock();
{
struct gendisk *disk = req->rq_disk;
- if (!disk || !blk_queue_io_stat(disk->queue))
+ if (!disk || !blk_do_io_stat(disk->queue))
return;
if (blk_fs_request(req)) {
{
struct gendisk *disk = req->rq_disk;
- if (!disk || !blk_queue_io_stat(disk->queue))
+ if (!disk || !blk_do_io_stat(disk->queue))
return;
/*
#endif
}
+static inline int blk_do_io_stat(struct request_queue *q)
+{
+ if (q)
+ return blk_queue_io_stat(q);
+
+ return 0;
+}
+
#endif