From: Hannes Reinecke <hare@suse.de>
To: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>,
James Bottomley <james.bottomley@hansenpartnership.com>,
linux-scsi@vger.kernel.org,
Sreekanth Reddy <sreekanth.reddy@broadcom.com>,
Kashyap Desai <kashyap.desai@broadcom.com>,
Sathya Prakash <sathya.prakash@broadcom.com>,
Hannes Reinecke <hare@suse.de>, Hannes Reinecke <hare@suse.com>
Subject: [PATCHv4 2/3] block: Add blk_mq_make_unique_tag()
Date: Wed, 22 Feb 2017 11:33:34 +0100 [thread overview]
Message-ID: <1487759615-3989-3-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1487759615-3989-1-git-send-email-hare@suse.de>
Implement blk_mq_make_unique_tag() to generate a unique tag
value from a given hardware queue and tag value.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
block/blk-mq-tag.c | 3 +--
include/linux/blk-mq.h | 5 +++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index dcf5ce3..2df6d35 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -450,8 +450,7 @@ u32 blk_mq_unique_tag(struct request *rq)
hwq = hctx->queue_num;
}
- return (hwq << BLK_MQ_UNIQUE_TAG_BITS) |
- (rq->tag & BLK_MQ_UNIQUE_TAG_MASK);
+ return blk_mq_make_unique_tag(hwq, rq->tag);
}
EXPORT_SYMBOL(blk_mq_unique_tag);
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 4a2ab5d9..1442c34 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -212,6 +212,11 @@ static inline u16 blk_mq_unique_tag_to_tag(u32 unique_tag)
return unique_tag & BLK_MQ_UNIQUE_TAG_MASK;
}
+static inline u32 blk_mq_make_unique_tag(u16 hwq, u16 tag)
+{
+ return (hwq << BLK_MQ_UNIQUE_TAG_BITS) |
+ (tag & BLK_MQ_UNIQUE_TAG_MASK);
+}
int blk_mq_request_started(struct request *rq);
void blk_mq_start_request(struct request *rq);
--
1.8.5.6
next prev parent reply other threads:[~2017-02-22 10:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-22 10:33 [PATCHv4 0/3] mpt3sas: exposing all reply queues Hannes Reinecke
2017-02-22 10:33 ` [PATCHv4 1/3] mpt3sas: Use 'msix_index' as argument for put_smid functions Hannes Reinecke
2017-02-22 10:33 ` Hannes Reinecke [this message]
2017-02-22 10:33 ` [PATCHv4 3/3] mpt3sas: scsi-mq interrupt steering Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1487759615-3989-3-git-send-email-hare@suse.de \
--to=hare@suse.de \
--cc=hare@suse.com \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox