linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 4/9] nvme: remove nvme_req_needs_failover
Date: Thu, 26 Jul 2018 17:35:00 +0200	[thread overview]
Message-ID: <20180726153505.4153-5-hch@lst.de> (raw)
In-Reply-To: <20180726153505.4153-1-hch@lst.de>

Now that we just call out to blk_path_error there isn't really any good
reason to not merge it into the only caller.

Signed-off-by: Christoph Hellwig <hch at lst.de>
Reviewed-by: Sagi Grimberg <sagi at grimberg.me>
Reviewed-by: Hannes Reinecke <hare at suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
---
 drivers/nvme/host/core.c      | 3 ++-
 drivers/nvme/host/multipath.c | 7 -------
 drivers/nvme/host/nvme.h      | 6 ------
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 4552167f8b2b..456d37a02ea3 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -236,7 +236,8 @@ void nvme_complete_rq(struct request *req)
 	trace_nvme_complete_rq(req);
 
 	if (unlikely(status != BLK_STS_OK && nvme_req_needs_retry(req))) {
-		if (nvme_req_needs_failover(req, status)) {
+		if ((req->cmd_flags & REQ_NVME_MPATH) &&
+		    blk_path_error(status)) {
 			nvme_failover_req(req);
 			return;
 		}
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 1ffd3e8b13a1..348aa405b641 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -56,13 +56,6 @@ void nvme_failover_req(struct request *req)
 	kblockd_schedule_work(&ns->head->requeue_work);
 }
 
-bool nvme_req_needs_failover(struct request *req, blk_status_t error)
-{
-	if (!(req->cmd_flags & REQ_NVME_MPATH))
-		return false;
-	return blk_path_error(error);
-}
-
 void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl)
 {
 	struct nvme_ns *ns;
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index f463eaf56db5..07452adef110 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -453,7 +453,6 @@ extern const struct block_device_operations nvme_ns_head_ops;
 void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns,
 			struct nvme_ctrl *ctrl, int *flags);
 void nvme_failover_req(struct request *req);
-bool nvme_req_needs_failover(struct request *req, blk_status_t error);
 void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl);
 int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl,struct nvme_ns_head *head);
 void nvme_mpath_add_disk(struct nvme_ns_head *head);
@@ -490,11 +489,6 @@ static inline void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns,
 static inline void nvme_failover_req(struct request *req)
 {
 }
-static inline bool nvme_req_needs_failover(struct request *req,
-					   blk_status_t error)
-{
-	return false;
-}
 static inline void nvme_kick_requeue_lists(struct nvme_ctrl *ctrl)
 {
 }
-- 
2.18.0

  parent reply	other threads:[~2018-07-26 15:35 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-26 15:34 draft ANA support v6 Christoph Hellwig
2018-07-26 15:34 ` [PATCH 1/9] nvme.h: add support for the log specific field Christoph Hellwig
2018-07-26 15:34 ` [PATCH 2/9] nvme.h: add ANA definitions Christoph Hellwig
2018-07-26 15:34 ` [PATCH 3/9] nvme: simplify the API for getting log pages Christoph Hellwig
2018-07-26 15:35 ` Christoph Hellwig [this message]
2018-07-26 15:35 ` [PATCH 5/9] nvme: add ANA support Christoph Hellwig
2018-07-26 17:20   ` Mike Snitzer
2018-07-27 13:20     ` Hannes Reinecke
2018-07-27 13:38       ` Mike Snitzer
2018-07-26 15:35 ` [PATCH 6/9] nvmet: keep a port pointer in nvmet_ctrl Christoph Hellwig
2018-07-26 15:35 ` [PATCH 7/9] nvmet: track and limit the number of namespaces per subsystem Christoph Hellwig
2018-07-26 15:35 ` [PATCH 8/9] nvmet: add minimal ANA support Christoph Hellwig
2018-07-26 15:35 ` [PATCH 9/9] nvmet: support configuring ANA groups Christoph Hellwig
2018-07-27  6:06 ` draft ANA support v6 Hannes Reinecke
2018-07-27  7:37   ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2018-07-24 11:50 draft ANA support v5 Christoph Hellwig
2018-07-24 11:50 ` [PATCH 4/9] nvme: remove nvme_req_needs_failover Christoph Hellwig

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=20180726153505.4153-5-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;
as well as URLs for NNTP newsgroup(s).