All of lore.kernel.org
 help / color / mirror / Atom feed
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
To: jens.axboe@oracle.com
Cc: tj@kernel.org, linux-kernel@vger.kernel.org,
	benh@kernel.crashing.org,
	FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] swim3: use blk_end_request instead of blk_update_request
Date: Tue, 12 May 2009 20:29:47 +0900	[thread overview]
Message-ID: <1242127787-29842-3-git-send-email-fujita.tomonori@lab.ntt.co.jp> (raw)
In-Reply-To: <1242127787-29842-1-git-send-email-fujita.tomonori@lab.ntt.co.jp>

swim3 is the only user of blk_update_request(). Let's use
blk_end_request instead of blk_update_request. swim3 doesn't need to
update a request manually. In addition, we can unexport
blk_update_request().

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 drivers/block/swim3.c |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index 116d169..0dd619a 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -726,18 +726,21 @@ static irqreturn_t swim3_interrupt(int irq, void *dev_id)
 		resid = ld_le16(&cp->res_count);
 		if (intr & ERROR_INTR) {
 			n = fs->scount - 1 - resid / 512;
-			if (n > 0) {
-				blk_update_request(fd_req, 0, n << 9);
+			if (blk_end_request(fd_req, 0, n << 9)) {
 				fs->req_sector += n;
-			}
-			if (fs->retries < 5) {
-				++fs->retries;
-				act(fs);
+
+				if (fs->retries < 5) {
+					++fs->retries;
+					act(fs);
+				} else {
+					printk("swim3: error %sing block %ld (err=%x)\n",
+					       rq_data_dir(fd_req) == WRITE? "writ": "read",
+					       (long)blk_rq_pos(fd_req), err);
+					blk_end_request_all(fd_req, -EIO);
+					fd_req = NULL;
+					fs->state = idle;
+				}
 			} else {
-				printk("swim3: error %sing block %ld (err=%x)\n",
-				       rq_data_dir(fd_req) == WRITE? "writ": "read",
-				       (long)blk_rq_pos(fd_req), err);
-				blk_end_request_all(fd_req, -EIO);
 				fd_req = NULL;
 				fs->state = idle;
 			}
-- 
1.6.0.6


  parent reply	other threads:[~2009-05-12 11:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-12 11:29 [PATCH 0/2] swim3: use blk_end_request_all() FUJITA Tomonori
2009-05-12 11:29 ` [PATCH] swim3: use blk_end_request_all when we hit the maximum retry count FUJITA Tomonori
2009-05-12 11:29 ` FUJITA Tomonori [this message]
2009-05-12 14:45   ` [PATCH] swim3: use blk_end_request instead of blk_update_request Boaz Harrosh
2009-05-12 15:06     ` FUJITA Tomonori
2009-05-12 15:27     ` Tejun Heo
2009-05-13  0:50       ` Kiyoshi Ueda
2009-05-13  5:49         ` Jens Axboe
2009-05-13  5:52           ` Tejun Heo
2009-05-13  5:59             ` Jens Axboe
2009-05-12 15:25 ` [PATCH 0/2] swim3: use blk_end_request_all() Tejun Heo
2009-05-12 15:31   ` FUJITA Tomonori
2009-05-12 15:36     ` Tejun Heo
2009-05-12 15:51       ` FUJITA Tomonori
2009-05-12 22:58         ` Tejun Heo

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=1242127787-29842-3-git-send-email-fujita.tomonori@lab.ntt.co.jp \
    --to=fujita.tomonori@lab.ntt.co.jp \
    --cc=benh@kernel.crashing.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.