* [PATCH] nvme: Unroll nvme_req_needs_retry
@ 2016-06-20 18:10 Jon Derrick
0 siblings, 0 replies; only message in thread
From: Jon Derrick @ 2016-06-20 18:10 UTC (permalink / raw)
nvme_req_needs_retry is becoming unreadable, so let's roll it out.
Signed-off-by: Jon Derrick <jonathan.derrick at intel.com>
---
Depends on "nvme: Limit command retries":
http://lists.infradead.org/pipermail/linux-nvme/2016-June/005114.html
drivers/nvme/host/nvme.h | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h
index 8ab141d..bf06793 100644
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -205,9 +205,13 @@ 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;
+ if (status & NVME_SC_DNR || blk_noretry_request(req))
+ return false;
+ if ((jiffies - req->start_time) >= req->timeout)
+ return false;
+ if (req->retries >= nvme_max_retries)
+ return false;
+ return true;
}
void nvme_cancel_request(struct request *req, void *data, bool reserved);
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-06-20 18:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-20 18:10 [PATCH] nvme: Unroll nvme_req_needs_retry Jon Derrick
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).