nvme: remove nvme_req_needs_failover
authorChristoph Hellwig <hch@lst.de>
Mon, 4 Jun 2018 06:43:00 +0000 (08:43 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 27 Jul 2018 17:12:05 +0000 (19:12 +0200)
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@lst.de>
Reviewed-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
drivers/nvme/host/core.c
drivers/nvme/host/multipath.c
drivers/nvme/host/nvme.h

index 4552167f8b2be8178dae16fb94245b251c0dcd61..456d37a02ea35fa3367354436be7e2e558b2a4f8 100644 (file)
@@ -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;
                }
index 1ffd3e8b13a18dccf887beac8d1d053e64ce9c9b..348aa405b641c95ad64f8a347eb40efc3e4dda86 100644 (file)
@@ -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;
index f463eaf56db5e7ef9f7c95fb80b976653243b172..07452adef11069c3a31a1f262b6ad8a873cf704c 100644 (file)
@@ -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)
 {
 }