summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host/nvme.h
diff options
context:
space:
mode:
authorChristoph Hellwig2017-03-30 13:41:32 +0200
committerJens Axboe2017-04-04 17:48:23 +0200
commit77f02a7acd7654cd5944f2120831d1eace94b343 (patch)
treebee45db17a2a2f705c939f0769671008c3b3fda3 /drivers/nvme/host/nvme.h
parentnvme-fc: drop ctrl for all command completions (diff)
downloadkernel-qcow2-linux-77f02a7acd7654cd5944f2120831d1eace94b343.tar.gz
kernel-qcow2-linux-77f02a7acd7654cd5944f2120831d1eace94b343.tar.xz
kernel-qcow2-linux-77f02a7acd7654cd5944f2120831d1eace94b343.zip
nvme: factor request completion code into a common helper
This avoids duplicating the logic four times, and it also allows to keep some helpers static in core.c or just opencode them. Note that this loses printing the aborted status on completions in the PCI driver as that uses a data structure not available any more. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r--drivers/nvme/host/nvme.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 2aa20e3e5675..227f281482db 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -261,13 +261,7 @@ static inline int nvme_error_status(u16 status)
}
}
-static inline bool nvme_req_needs_retry(struct request *req, u16 status)
-{
- return !(status & NVME_SC_DNR || blk_noretry_request(req)) &&
- (jiffies - req->start_time) < req->timeout &&
- req->retries < nvme_max_retries;
-}
-
+void nvme_complete_rq(struct request *req);
void nvme_cancel_request(struct request *req, void *data, bool reserved);
bool nvme_change_ctrl_state(struct nvme_ctrl *ctrl,
enum nvme_ctrl_state new_state);
@@ -302,7 +296,6 @@ void nvme_start_freeze(struct nvme_ctrl *ctrl);
#define NVME_QID_ANY -1
struct request *nvme_alloc_request(struct request_queue *q,
struct nvme_command *cmd, unsigned int flags, int qid);
-void nvme_requeue_req(struct request *req);
int nvme_setup_cmd(struct nvme_ns *ns, struct request *req,
struct nvme_command *cmd);
int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,