Skip to content

Commit 723bf17

Browse files
Ming Leiaxboe
authored andcommitted
blk-mq: move blk_mq_put_driver_tag() into blk-mq.c
It is used by blk-mq.c only, so move it to the source file. Suggested-by: Christoph Hellwig <[email protected]> Signed-off-by: Ming Lei <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Cc: Christoph Hellwig <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 570e9b7 commit 723bf17

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

block/blk-mq.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,26 @@ static inline bool blk_mq_complete_need_ipi(struct request *rq)
666666
return cpu_online(rq->mq_ctx->cpu);
667667
}
668668

669+
static void __blk_mq_put_driver_tag(struct blk_mq_hw_ctx *hctx,
670+
struct request *rq)
671+
{
672+
blk_mq_put_tag(hctx->tags, rq->mq_ctx, rq->tag);
673+
rq->tag = BLK_MQ_NO_TAG;
674+
675+
if (rq->rq_flags & RQF_MQ_INFLIGHT) {
676+
rq->rq_flags &= ~RQF_MQ_INFLIGHT;
677+
atomic_dec(&hctx->nr_active);
678+
}
679+
}
680+
681+
static inline void blk_mq_put_driver_tag(struct request *rq)
682+
{
683+
if (rq->tag == BLK_MQ_NO_TAG || rq->internal_tag == BLK_MQ_NO_TAG)
684+
return;
685+
686+
__blk_mq_put_driver_tag(rq->mq_hctx, rq);
687+
}
688+
669689
bool blk_mq_complete_request_remote(struct request *rq)
670690
{
671691
WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);

block/blk-mq.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -193,26 +193,6 @@ static inline bool blk_mq_get_dispatch_budget(struct request_queue *q)
193193
return true;
194194
}
195195

196-
static inline void __blk_mq_put_driver_tag(struct blk_mq_hw_ctx *hctx,
197-
struct request *rq)
198-
{
199-
blk_mq_put_tag(hctx->tags, rq->mq_ctx, rq->tag);
200-
rq->tag = BLK_MQ_NO_TAG;
201-
202-
if (rq->rq_flags & RQF_MQ_INFLIGHT) {
203-
rq->rq_flags &= ~RQF_MQ_INFLIGHT;
204-
atomic_dec(&hctx->nr_active);
205-
}
206-
}
207-
208-
static inline void blk_mq_put_driver_tag(struct request *rq)
209-
{
210-
if (rq->tag == BLK_MQ_NO_TAG || rq->internal_tag == BLK_MQ_NO_TAG)
211-
return;
212-
213-
__blk_mq_put_driver_tag(rq->mq_hctx, rq);
214-
}
215-
216196
static inline void blk_mq_clear_mq_map(struct blk_mq_queue_map *qmap)
217197
{
218198
int cpu;

0 commit comments

Comments
 (0)