From: minwoo.im.dev@gmail.com (Minwoo Im)
Subject: [PATCH] nvme: simplify nvme_req_qid()
Date: Sun, 4 Aug 2019 16:19:02 +0900 [thread overview]
Message-ID: <20190804071902.31872-1-minwoo.im.dev@gmail.com> (raw)
blk_mq_unique_tag() just makes a unique tag which holds not only the
tag, but also the queue_num of the hctx. With this unique tag,
blk_mq_unique_tag_to_hwq is nothing but removing the tag from it.
Therefore the qid or the I/O queues can simply be:
(struct blk_mq_hw_ctx *)->queue_num + 1
Cc: Keith Busch <kbusch at kernel.org>
Cc: Jens Axboe <axboe at fb.com>
Cc: Christoph Hellwig <hch at lst.de>
Cc: Sagi Grimberg <sagi at grimberg.me>
Signed-off-by: Minwoo Im <minwoo.im.dev at gmail.com>
---
drivers/nvme/host/nvme.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 26b563f9985b..2e76198f5833 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -126,7 +126,7 @@ static inline u16 nvme_req_qid(struct request *req)
{
if (!req->rq_disk)
return 0;
- return blk_mq_unique_tag_to_hwq(blk_mq_unique_tag(req)) + 1;
+ return req->mq_hctx->queue_num + 1;
}
/* The below value is the specific amount of delay needed before checking
--
2.17.1
next reply other threads:[~2019-08-04 7:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-04 7:19 Minwoo Im [this message]
2019-08-05 18:10 ` [PATCH] nvme: simplify nvme_req_qid() Sagi Grimberg
2019-08-12 11:01 ` Minwoo Im
2019-08-13 6:26 ` Sagi Grimberg
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=20190804071902.31872-1-minwoo.im.dev@gmail.com \
--to=minwoo.im.dev@gmail.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