[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1241751256-17435-8-git-send-email-tj@kernel.org>
Date: Fri, 8 May 2009 11:54:05 +0900
From: Tejun Heo <tj@...nel.org>
To: linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
linux-ide@...r.kernel.org, rusty@...tcorp.com.au,
James.Bottomley@...senPartnership.com, mike.miller@...com,
donari75@...il.com, paul.clements@...eleye.com, tim@...erelk.net,
Geert.Uytterhoeven@...ycom.com, davem@...emloft.net,
Laurent@...vier.info, jgarzik@...ox.com, jeremy@...source.com,
grant.likely@...retlab.ca, adrian@...en.demon.co.uk,
sfr@...b.auug.org.au, bzolnier@...il.com, petkovbb@...glemail.com,
sshtylyov@...mvista.com, oakad@...oo.com, drzeus@...eus.cx,
dwmw2@...radead.org, Markus.Lidel@...dowconnect.com,
wein@...ibm.com, schwidefsky@...ibm.com, zaitcev@...hat.com,
fujita.tomonori@....ntt.co.jp, axboe@...nel.dk
Cc: Tejun Heo <tj@...nel.org>
Subject: [PATCH 07/18] xsysace: dequeue in-flight request
xsysace already tracks in-flight request using ace->req. Converting
to dequeueing model is mostly a matter of adding dequeueing call after
request fetching. The only tricky part is handling CF removal which
should complete both in flight and on queue requests. Convert to
dequeueing model.
While at it, remove explicit blk_rq_cur_bytes() and use
__blk_end_request_cur() instead.
[ Impact: dequeue in-flight request ]
Signed-off-by: Tejun Heo <tj@...nel.org>
Cc: Grant Likely <grant.likely@...retlab.ca>
---
drivers/block/xsysace.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 97c99b4..edf137b 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -466,7 +466,8 @@ struct request *ace_get_next_request(struct request_queue * q)
while ((req = elv_next_request(q)) != NULL) {
if (blk_fs_request(req))
break;
- __blk_end_request_cur(req, -EIO);
+ blkdev_dequeue_request(req);
+ __blk_end_request_all(req, -EIO);
}
return req;
}
@@ -492,9 +493,15 @@ static void ace_fsm_dostate(struct ace_device *ace)
set_capacity(ace->gd, 0);
dev_info(ace->dev, "No CF in slot\n");
- /* Drop all pending requests */
- while ((req = elv_next_request(ace->queue)) != NULL)
- __blk_end_request_cur(req, -EIO);
+ /* Drop all in-flight and pending requests */
+ if (ace->req) {
+ __blk_end_request_all(ace->req, -EIO);
+ ace->req = NULL;
+ }
+ while ((req = elv_next_request(ace->queue)) != NULL) {
+ blkdev_dequeue_request(req);
+ __blk_end_request_all(req, -EIO);
+ }
/* Drop back to IDLE state and notify waiters */
ace->fsm_state = ACE_FSM_STATE_IDLE;
@@ -642,6 +649,7 @@ static void ace_fsm_dostate(struct ace_device *ace)
ace->fsm_state = ACE_FSM_STATE_IDLE;
break;
}
+ blkdev_dequeue_request(req);
/* Okay, it's a data request, set it up for transfer */
dev_dbg(ace->dev,
@@ -718,8 +726,7 @@ static void ace_fsm_dostate(struct ace_device *ace)
}
/* bio finished; is there another one? */
- if (__blk_end_request(ace->req, 0,
- blk_rq_cur_bytes(ace->req))) {
+ if (__blk_end_request_cur(ace->req, 0)) {
/* dev_dbg(ace->dev, "next block; h=%u c=%u\n",
* blk_rq_sectors(ace->req),
* blk_rq_cur_sectors(ace->req));
--
1.6.0.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists