linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jonathan.derrick@intel.com (Jon Derrick)
Subject: [PATCH] nvme: Unroll nvme_req_needs_retry
Date: Mon, 20 Jun 2016 12:10:25 -0600	[thread overview]
Message-ID: <1466446225-29649-1-git-send-email-jonathan.derrick@intel.com> (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

                 reply	other threads:[~2016-06-20 18:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1466446225-29649-1-git-send-email-jonathan.derrick@intel.com \
    --to=jonathan.derrick@intel.com \
    /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).