diff options
author | Jens Axboe <axboe@suse.de> | 2006-07-13 05:55:04 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-09-30 14:26:57 -0400 |
commit | 2e662b65f05d550b6799ed6bfa9963b82279e6b7 (patch) | |
tree | 82911ec73a52d149d74a3d13c3c5eedb269a19cb /block/ll_rw_blk.c | |
parent | 10fd48f2376db52f08bf0420d2c4f580e39269e1 (diff) |
[PATCH] elevator: abstract out the rbtree sort handling
The rbtree sort/lookup/reposition logic is mostly duplicated in
cfq/deadline/as, so move it to the elevator core. The io schedulers
still provide the actual rb root, as we don't want to impose any sort
of specific handling on the schedulers.
Introduce the helpers and rb_node in struct request to help migrate the
IO schedulers.
Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block/ll_rw_blk.c')
-rw-r--r-- | block/ll_rw_blk.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 9cbf7b550c78..d388486e98bb 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -281,11 +281,12 @@ 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); | ||
285 | 284 | ||
286 | rq->errors = 0; | 285 | rq->errors = 0; |
287 | rq->rq_status = RQ_ACTIVE; | 286 | rq->rq_status = RQ_ACTIVE; |
288 | rq->bio = rq->biotail = NULL; | 287 | rq->bio = rq->biotail = NULL; |
288 | INIT_HLIST_NODE(&rq->hash); | ||
289 | RB_CLEAR_NODE(&rq->rb_node); | ||
289 | rq->ioprio = 0; | 290 | rq->ioprio = 0; |
290 | rq->buffer = NULL; | 291 | rq->buffer = NULL; |
291 | rq->ref_count = 1; | 292 | rq->ref_count = 1; |
@@ -2943,7 +2944,7 @@ static int __make_request(request_queue_t *q, struct bio *bio) | |||
2943 | req->ioprio = ioprio_best(req->ioprio, prio); | 2944 | req->ioprio = ioprio_best(req->ioprio, prio); |
2944 | drive_stat_acct(req, nr_sectors, 0); | 2945 | drive_stat_acct(req, nr_sectors, 0); |
2945 | if (!attempt_back_merge(q, req)) | 2946 | if (!attempt_back_merge(q, req)) |
2946 | elv_merged_request(q, req); | 2947 | elv_merged_request(q, req, el_ret); |
2947 | goto out; | 2948 | goto out; |
2948 | 2949 | ||
2949 | case ELEVATOR_FRONT_MERGE: | 2950 | case ELEVATOR_FRONT_MERGE: |
@@ -2970,7 +2971,7 @@ static int __make_request(request_queue_t *q, struct bio *bio) | |||
2970 | req->ioprio = ioprio_best(req->ioprio, prio); | 2971 | req->ioprio = ioprio_best(req->ioprio, prio); |
2971 | drive_stat_acct(req, nr_sectors, 0); | 2972 | drive_stat_acct(req, nr_sectors, 0); |
2972 | if (!attempt_front_merge(q, req)) | 2973 | if (!attempt_front_merge(q, req)) |
2973 | elv_merged_request(q, req); | 2974 | elv_merged_request(q, req, el_ret); |
2974 | goto out; | 2975 | goto out; |
2975 | 2976 | ||
2976 | /* ELV_NO_MERGE: elevator says don't/can't merge. */ | 2977 | /* ELV_NO_MERGE: elevator says don't/can't merge. */ |