diff options
author | Jens Axboe <axboe@suse.de> | 2006-07-28 03:23:08 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:26:56 -0400 |
commit | 9817064b68fef7e4580c6df1ea597e106b9ff88b (patch) | |
tree | 76c27990626247613e9efa45b792d51ad79635d7 /block/ll_rw_blk.c | |
parent | 4aff5e2333c9a1609662f2091f55c3f6fffdad36 (diff) |
[PATCH] elevator: move the backmerging logic into the elevator core
Right now, every IO scheduler implements its own backmerging (except for
noop, which does no merging). That results in duplicated code for
essentially the same operation, which is never a good thing. This patch
moves the backmerging out of the io schedulers and into the elevator
core. We save 1.6kb of text and as a bonus get backmerging for noop as
well. Win-win!
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block/ll_rw_blk.c')
-rw-r--r-- | block/ll_rw_blk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 9b91bb70c5ed..9cbf7b550c78 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -281,6 +281,7 @@ static inline void rq_init(request_queue_t *q, struct request *rq) | |||
281 | { | 281 | { |
282 | INIT_LIST_HEAD(&rq->queuelist); | 282 | INIT_LIST_HEAD(&rq->queuelist); |
283 | INIT_LIST_HEAD(&rq->donelist); | 283 | INIT_LIST_HEAD(&rq->donelist); |
284 | INIT_HLIST_NODE(&rq->hash); | ||
284 | 285 | ||
285 | rq->errors = 0; | 286 | rq->errors = 0; |
286 | rq->rq_status = RQ_ACTIVE; | 287 | rq->rq_status = RQ_ACTIVE; |
@@ -2700,6 +2701,7 @@ void __blk_put_request(request_queue_t *q, struct request *req) | |||
2700 | int priv = req->cmd_flags & REQ_ELVPRIV; | 2701 | int priv = req->cmd_flags & REQ_ELVPRIV; |
2701 | 2702 | ||
2702 | BUG_ON(!list_empty(&req->queuelist)); | 2703 | BUG_ON(!list_empty(&req->queuelist)); |
2704 | BUG_ON(!hlist_unhashed(&req->hash)); | ||
2703 | 2705 | ||
2704 | blk_free_request(q, req); | 2706 | blk_free_request(q, req); |
2705 | freed_request(q, rw, priv); | 2707 | freed_request(q, rw, priv); |