diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2018-12-14 11:06:06 -0800 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2018-12-18 17:50:47 +0100 |
commit | 7b7ab780a048699d2b9f416bf2d5c089d8d1028c (patch) | |
tree | f0bed21ab970400a453daa63ee4d44e5c170246d /include/linux/blk-mq.h | |
parent | 56a77d26d6316a3936497236c7e3a6a98fad950c (diff) | |
download | linux-7b7ab780a048699d2b9f416bf2d5c089d8d1028c.tar.gz linux-7b7ab780a048699d2b9f416bf2d5c089d8d1028c.tar.bz2 linux-7b7ab780a048699d2b9f416bf2d5c089d8d1028c.zip |
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>
Diffstat (limited to 'include/linux/blk-mq.h')
-rw-r--r-- | include/linux/blk-mq.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index d3c0a0d2680b..0e030f5f76b6 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -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 |