block: make request_to_qc_t public
block consumers will need it for polling requests that are sent with blk_execute_rq_nowait. Also, get rid of blk_tag_to_qc_t and open-code it instead. Reviewed-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:

committed by
Christoph Hellwig

parent
56a77d26d6
commit
7b7ab780a0
@@ -357,4 +357,14 @@ static inline void *blk_mq_rq_to_pdu(struct request *rq)
|
||||
for ((i) = 0; (i) < (hctx)->nr_ctx && \
|
||||
({ ctx = (hctx)->ctxs[(i)]; 1; }); (i)++)
|
||||
|
||||
static inline blk_qc_t request_to_qc_t(struct blk_mq_hw_ctx *hctx,
|
||||
struct request *rq)
|
||||
{
|
||||
if (rq->tag != -1)
|
||||
return rq->tag | (hctx->queue_num << BLK_QC_T_SHIFT);
|
||||
|
||||
return rq->internal_tag | (hctx->queue_num << BLK_QC_T_SHIFT) |
|
||||
BLK_QC_T_INTERNAL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user