Prepare for adding more code that uses the request queue pointer. Cc: Damien Le Moal <damien.lemoal@xxxxxxxxxxxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Cc: Ming Lei <ming.lei@xxxxxxxxxx> Cc: Mike Snitzer <snitzer@xxxxxxxxxx> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- block/mq-deadline.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/block/mq-deadline.c b/block/mq-deadline.c index 891ee0da73ac..8c2bc9fdcf8c 100644 --- a/block/mq-deadline.c +++ b/block/mq-deadline.c @@ -368,6 +368,7 @@ static struct request * deadline_next_request(struct deadline_data *dd, struct dd_per_prio *per_prio, enum dd_data_dir data_dir) { + struct request_queue *q; struct request *rq; unsigned long flags; @@ -375,7 +376,8 @@ deadline_next_request(struct deadline_data *dd, struct dd_per_prio *per_prio, if (!rq) return NULL; - if (data_dir == DD_READ || !blk_queue_is_zoned(rq->q)) + q = rq->q; + if (data_dir == DD_READ || !blk_queue_is_zoned(q)) return rq; /* @@ -389,7 +391,7 @@ deadline_next_request(struct deadline_data *dd, struct dd_per_prio *per_prio, while (rq) { if (blk_req_can_dispatch_to_zone(rq)) break; - if (blk_queue_nonrot(rq->q)) + if (blk_queue_nonrot(q)) rq = deadline_latter_request(rq); else rq = deadline_skip_seq_writes(dd, rq);