[PATCH 2/3] block: change elevator to use blk-end-request

From: Kiyoshi Ueda
Date: Fri Jan 11 2008 - 16:52:20 EST


This patch converts elevator to use __blk_end_request() directly
so that end_{queued|dequeued}_request() can be removed.
Related 'uptodate' arguments is converted to 'error'.

__blk_end_request() takes care of dequeueing request like below:

if (!list_empty(&rq->queuelist))
blkdev_dequeue_request(rq);

In the case of elv_next_request(), blkdev_dequeue_request() has not
been done and the queuelist isn't empty.
So __blk_end_request() calls blkdev_dequeue_request() and
the behavior of elv_next_request() doesn't change.

Signed-off-by: Kiyoshi Ueda <k-ueda@xxxxxxxxxxxxx>
Signed-off-by: Jun'ichi Nomura <j-nomura@xxxxxxxxxxxxx>
---
block/elevator.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

Index: 2.6.24-rc7/block/elevator.c
===================================================================
--- 2.6.24-rc7.orig/block/elevator.c
+++ 2.6.24-rc7/block/elevator.c
@@ -717,7 +717,7 @@ struct request *elv_next_request(struct
* not ever see it.
*/
if (blk_empty_barrier(rq)) {
- end_queued_request(rq, 1);
+ __blk_end_request(rq, 0, blk_rq_bytes(rq));
continue;
}
if (!(rq->cmd_flags & REQ_STARTED)) {
@@ -760,7 +760,7 @@ struct request *elv_next_request(struct
break;
} else if (ret == BLKPREP_KILL) {
rq->cmd_flags |= REQ_QUIET;
- end_queued_request(rq, 0);
+ __blk_end_request(rq, -EIO, blk_rq_bytes(rq));
} else {
printk(KERN_ERR "%s: bad return=%d\n", __FUNCTION__,
ret);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/