summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-10-12 13:12:17 +0200
committerJens Axboe <axboe@kernel.dk>2021-10-18 06:17:36 -0600
commitefbabbe121f96d4b1a98a2c2ef5d2e8f7fb41c87 (patch)
treeba855272ab54f5a6acc878a23ddbc11ae163cc6a /block
parentc6699d6fe0ffe4d9fdc652d1acf5a94b4f9627ba (diff)
downloadlinux-efbabbe121f96d4b1a98a2c2ef5d2e8f7fb41c87.tar.bz2
blk-mq: remove blk_qc_t_to_tag and blk_qc_t_is_internal
Merge both functions into their only caller to keep the blk-mq tag to blk_qc_t mapping as private as possible in blk-mq.c. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Tested-by: Mark Wunderlich <mark.wunderlich@intel.com> Link: https://lore.kernel.org/r/20211012111226.760968-8-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 636773056874..24a10c973f79 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -74,9 +74,11 @@ static inline struct blk_mq_hw_ctx *blk_qc_to_hctx(struct request_queue *q,
static inline struct request *blk_qc_to_rq(struct blk_mq_hw_ctx *hctx,
blk_qc_t qc)
{
- if (blk_qc_t_is_internal(qc))
- return blk_mq_tag_to_rq(hctx->sched_tags, blk_qc_t_to_tag(qc));
- return blk_mq_tag_to_rq(hctx->tags, blk_qc_t_to_tag(qc));
+ unsigned int tag = qc & ((1U << BLK_QC_T_SHIFT) - 1);
+
+ if (qc & BLK_QC_T_INTERNAL)
+ return blk_mq_tag_to_rq(hctx->sched_tags, tag);
+ return blk_mq_tag_to_rq(hctx->tags, tag);
}
/*