Commit efbabbe1 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
Tested-by: default avatarMark Wunderlich <mark.wunderlich@intel.com>
Link: https://lore.kernel.org/r/20211012111226.760968-8-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent c6699d6f
...@@ -74,9 +74,11 @@ static inline struct blk_mq_hw_ctx *blk_qc_to_hctx(struct request_queue *q, ...@@ -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, static inline struct request *blk_qc_to_rq(struct blk_mq_hw_ctx *hctx,
blk_qc_t qc) blk_qc_t qc)
{ {
if (blk_qc_t_is_internal(qc)) unsigned int tag = qc & ((1U << BLK_QC_T_SHIFT) - 1);
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)); 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);
} }
/* /*
......
...@@ -505,16 +505,6 @@ static inline bool blk_qc_t_valid(blk_qc_t cookie) ...@@ -505,16 +505,6 @@ static inline bool blk_qc_t_valid(blk_qc_t cookie)
return cookie != BLK_QC_T_NONE; return cookie != BLK_QC_T_NONE;
} }
static inline unsigned int blk_qc_t_to_tag(blk_qc_t cookie)
{
return cookie & ((1u << BLK_QC_T_SHIFT) - 1);
}
static inline bool blk_qc_t_is_internal(blk_qc_t cookie)
{
return (cookie & BLK_QC_T_INTERNAL) != 0;
}
struct blk_rq_stat { struct blk_rq_stat {
u64 mean; u64 mean;
u64 min; u64 min;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment