Blob Blame History Raw
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 31 Jul 2018 11:56:42 +0200
Subject: [PATCH] nvme: partially revert "nvme: remove nvme_req_needs_failover"
References: bsc#1054245
Patch-Mainline: never, kABI fix

Removing this function will break the kABI, so better don't.

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/nvme/host/multipath.c | 7 +++++++
 drivers/nvme/host/nvme.h      | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 420efcda33d9..c4c20ee6bf1e 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -91,6 +91,13 @@ 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 be4e2ab9f576..5ff3d1fc8df3 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -444,6 +444,7 @@ bool nvme_ctrl_use_ana(struct nvme_ctrl *ctrl);
 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 *ns, struct nvme_id_ns *id);
@@ -490,6 +491,11 @@ 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.12.3