kernel/block/blk-mq-tag.c
/**
 * blk_mq_unique_tag() - return a tag that is unique queue-wide
 * @rq: request for which to compute a unique tag
 *
 * The tag field in struct request is unique per hardware queue but not over
 * all hardware queues. Hence this function that returns a tag with the
 * hardware context index in the upper bits and the per hardware queue tag in
 * the lower bits.
 *
 * Note: When called for a request that is queued on a non-multiqueue request
 * queue, the hardware context index is set to zero.
 */
return a tag that is unique queue-wide
@rq: request for which to compute a unique tag

The tag field in struct request is unique per hardware queue but not over
all hardware queues. Hence this function that returns a tag with the
hardware context index in the upper bits and the per hardware queue tag in
the lower bits.

When called for a request that is queued on a non-multiqueue request
queue, the hardware context index is set to zero.
return a tag that is unique queue - wide @rq : request for which to compute a unique tag The tag field in struct request is unique per hardware queue but not over all hardware queues . Hence this function that returns a tag with the hardware context index in the upper bits and the per hardware queue tag in the lower bits . When called for a request that is queued on a non - multiqueue request queue the hardware context index is set to zero .
u32 blk_mq_unique_tag(struct request *rq)
{
	struct request_queue *q = rq->q;
	struct blk_mq_hw_ctx *hctx;
	int hwq = 0;
	if (q->mq_ops) {
		hctx = blk_mq_map_queue(q, rq->mq_ctx->cpu);
		hwq = hctx->queue_num;
	}
	return (hwq << BLK_MQ_UNIQUE_TAG_BITS) |
		(rq->tag & BLK_MQ_UNIQUE_TAG_MASK);
}
u32 blk_mq_unique_tag ( struct request * rq ) { struct request_queue * q = rq -> q ; struct blk_mq_hw_ctx * hctx ; int hwq = 0 ; if ( q -> mq_ops ) { hctx = blk_mq_map_queue ( q , rq -> mq_ctx -> cpu ) ; hwq = hctx -> queue_num ; } return ( hwq << BLK_MQ_UNIQUE_TAG_BITS ) | ( rq -> tag & BLK_MQ_UNIQUE_TAG_MASK ) ; }
blk_mq_unique_tag() - return a tag that is unique queue-wide
 @rq: request for which to compute a unique tag
blk_mq_unique_tag () - return a tag that is unique queue - wide @rq : request for which to compute a unique tag