|
@@ -1545,19 +1545,19 @@ void blk_mq_insert_requests(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
|
|
|
struct list_head *list)
|
|
|
|
|
|
{
|
|
|
+ struct request *rq;
|
|
|
+
|
|
|
/*
|
|
|
* preemption doesn't flush plug list, so it's possible ctx->cpu is
|
|
|
* offline now
|
|
|
*/
|
|
|
- spin_lock(&ctx->lock);
|
|
|
- while (!list_empty(list)) {
|
|
|
- struct request *rq;
|
|
|
-
|
|
|
- rq = list_first_entry(list, struct request, queuelist);
|
|
|
+ list_for_each_entry(rq, list, queuelist) {
|
|
|
BUG_ON(rq->mq_ctx != ctx);
|
|
|
- list_del_init(&rq->queuelist);
|
|
|
- __blk_mq_insert_req_list(hctx, rq, false);
|
|
|
+ trace_block_rq_insert(hctx->queue, rq);
|
|
|
}
|
|
|
+
|
|
|
+ spin_lock(&ctx->lock);
|
|
|
+ list_splice_tail_init(list, &ctx->rq_list);
|
|
|
blk_mq_hctx_mark_pending(hctx, ctx);
|
|
|
spin_unlock(&ctx->lock);
|
|
|
}
|