@@ -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);
Prepare for adding more code that uses the request queue pointer. Cc: Damien Le Moal <damien.lemoal@opensource.wdc.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Ming Lei <ming.lei@redhat.com> Cc: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Bart Van Assche <bvanassche@acm.org> --- block/mq-deadline.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)