Commit 312ccd4b authored by Bart Van Assche's avatar Bart Van Assche Committed by Jens Axboe
Browse files

blk-mq: Clean up blk_mq_requeue_work()



Move a statement that occurs in both branches of an if-statement in front
of the if-statement. Fix a typo in a source code comment. No functionality
has been changed.

Reviewed-by: default avatarDamien Le Moal <dlemoal@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarNitesh Shetty <nj.shetty@samsung.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20241212212941.1268662-3-bvanassche@acm.org


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent e01424fa
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -1544,20 +1544,18 @@ static void blk_mq_requeue_work(struct work_struct *work)

	while (!list_empty(&rq_list)) {
		rq = list_entry(rq_list.next, struct request, queuelist);
		list_del_init(&rq->queuelist);
		/*
		 * If RQF_DONTPREP ist set, the request has been started by the
		 * If RQF_DONTPREP is set, the request has been started by the
		 * driver already and might have driver-specific data allocated
		 * already.  Insert it into the hctx dispatch list to avoid
		 * block layer merges for the request.
		 */
		if (rq->rq_flags & RQF_DONTPREP) {
			list_del_init(&rq->queuelist);
		if (rq->rq_flags & RQF_DONTPREP)
			blk_mq_request_bypass_insert(rq, 0);
		} else {
			list_del_init(&rq->queuelist);
		else
			blk_mq_insert_request(rq, BLK_MQ_INSERT_AT_HEAD);
	}
	}

	while (!list_empty(&flush_list)) {
		rq = list_entry(flush_list.next, struct request, queuelist);