From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 2/4] nvme-fabrics: handle queue ready fast path inline
Date: Mon, 11 Jun 2018 17:46:45 +0200 [thread overview]
Message-ID: <20180611154647.32558-3-hch@lst.de> (raw)
In-Reply-To: <20180611154647.32558-1-hch@lst.de>
Avoid a function call for the queue live fast path.
Signed-off-by: Christoph Hellwig <hch at lst.de>
---
drivers/nvme/host/fabrics.c | 7 ++-----
drivers/nvme/host/fabrics.h | 10 +++++++++-
2 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
index 72d290c71a1e..6b4e253b9347 100644
--- a/drivers/nvme/host/fabrics.c
+++ b/drivers/nvme/host/fabrics.c
@@ -553,14 +553,11 @@ blk_status_t nvmf_fail_nonready_command(struct request *rq)
}
EXPORT_SYMBOL_GPL(nvmf_fail_nonready_command);
-bool nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
+bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
bool queue_live)
{
struct nvme_command *cmd = nvme_req(rq)->cmd;
- if (likely(ctrl->state == NVME_CTRL_LIVE))
- return true;
-
switch (ctrl->state) {
case NVME_CTRL_NEW:
case NVME_CTRL_CONNECTING:
@@ -588,7 +585,7 @@ bool nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
return false;
}
}
-EXPORT_SYMBOL_GPL(nvmf_check_ready);
+EXPORT_SYMBOL_GPL(__nvmf_check_ready);
static const match_table_t opt_tokens = {
{ NVMF_OPT_TRANSPORT, "transport=%s" },
diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h
index 2b7033d95cbd..2ea949a3868c 100644
--- a/drivers/nvme/host/fabrics.h
+++ b/drivers/nvme/host/fabrics.h
@@ -163,7 +163,15 @@ void nvmf_free_options(struct nvmf_ctrl_options *opts);
int nvmf_get_address(struct nvme_ctrl *ctrl, char *buf, int size);
bool nvmf_should_reconnect(struct nvme_ctrl *ctrl);
blk_status_t nvmf_fail_nonready_command(struct request *rq);
-bool nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
+bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
bool queue_live);
+static inline bool nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
+ bool queue_live)
+{
+ if (likely(ctrl->state == NVME_CTRL_LIVE))
+ return true;
+ return __nvmf_check_ready(ctrl, rq, queue_live);
+}
+
#endif /* _NVME_FABRICS_H */
--
2.17.1
next prev parent reply other threads:[~2018-06-11 15:46 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-11 15:46 queue ready fixes and cleanups Christoph Hellwig
2018-06-11 15:46 ` [PATCH 1/4] nvme-fabrics: refactor queue ready check Christoph Hellwig
2018-06-12 8:23 ` Johannes Thumshirn
2018-06-12 21:45 ` James Smart
2018-06-13 8:16 ` Christoph Hellwig
2018-06-13 15:54 ` James Smart
2018-06-14 12:19 ` Christoph Hellwig
2018-06-13 19:48 ` James Smart
2018-06-11 15:46 ` Christoph Hellwig [this message]
2018-06-12 8:24 ` [PATCH 2/4] nvme-fabrics: handle queue ready fast path inline Johannes Thumshirn
2018-06-12 21:47 ` James Smart
2018-06-11 15:46 ` [PATCH 3/4] nvme-fabrics: handle the admin-only case properly in nvmf_check_ready Christoph Hellwig
2018-06-12 8:25 ` Johannes Thumshirn
2018-06-12 21:48 ` James Smart
2018-06-13 7:59 ` Christoph Hellwig
2018-06-11 15:46 ` [PATCH 4/4] nvme-fabrics: reverse polarity in __nvmf_check_ready Christoph Hellwig
2018-06-12 8:26 ` Johannes Thumshirn
2018-06-12 11:08 ` Hannes Reinecke
2018-06-12 22:22 ` James Smart
2018-06-12 22:05 ` James Smart
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=20180611154647.32558-3-hch@lst.de \
--to=hch@lst.de \
/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