diff options
author | Tejun Heo <htejun@gmail.com> | 2005-10-20 10:46:54 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2005-10-28 02:45:35 -0400 |
commit | 98b11471d72a374f346bec50a00d0887719b85b3 (patch) | |
tree | 875feb99eacd983fdc9107eb1c3b68f24e641aa4 /drivers/block/cfq-iosched.c | |
parent | 06b86245c052963029bfd9020ca1f08ceb66f85a (diff) |
[PATCH] 04/05 remove last_merge handling from ioscheds
Remove last_merge handling from all ioscheds. This patch
removes merging capability of noop iosched.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/block/cfq-iosched.c')
-rw-r--r-- | drivers/block/cfq-iosched.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c index 7b14160e0798..62a19ed0443b 100644 --- a/drivers/block/cfq-iosched.c +++ b/drivers/block/cfq-iosched.c | |||
@@ -304,14 +304,6 @@ static inline void cfq_del_crq_hash(struct cfq_rq *crq) | |||
304 | hlist_del_init(&crq->hash); | 304 | hlist_del_init(&crq->hash); |
305 | } | 305 | } |
306 | 306 | ||
307 | static void cfq_remove_merge_hints(request_queue_t *q, struct cfq_rq *crq) | ||
308 | { | ||
309 | cfq_del_crq_hash(crq); | ||
310 | |||
311 | if (q->last_merge == crq->request) | ||
312 | q->last_merge = NULL; | ||
313 | } | ||
314 | |||
315 | static inline void cfq_add_crq_hash(struct cfq_data *cfqd, struct cfq_rq *crq) | 307 | static inline void cfq_add_crq_hash(struct cfq_data *cfqd, struct cfq_rq *crq) |
316 | { | 308 | { |
317 | const int hash_idx = CFQ_MHASH_FN(rq_hash_key(crq->request)); | 309 | const int hash_idx = CFQ_MHASH_FN(rq_hash_key(crq->request)); |
@@ -672,7 +664,7 @@ static void cfq_remove_request(struct request *rq) | |||
672 | 664 | ||
673 | list_del_init(&rq->queuelist); | 665 | list_del_init(&rq->queuelist); |
674 | cfq_del_crq_rb(crq); | 666 | cfq_del_crq_rb(crq); |
675 | cfq_remove_merge_hints(rq->q, crq); | 667 | cfq_del_crq_hash(crq); |
676 | } | 668 | } |
677 | 669 | ||
678 | static int | 670 | static int |
@@ -682,12 +674,6 @@ cfq_merge(request_queue_t *q, struct request **req, struct bio *bio) | |||
682 | struct request *__rq; | 674 | struct request *__rq; |
683 | int ret; | 675 | int ret; |
684 | 676 | ||
685 | ret = elv_try_last_merge(q, bio); | ||
686 | if (ret != ELEVATOR_NO_MERGE) { | ||
687 | __rq = q->last_merge; | ||
688 | goto out_insert; | ||
689 | } | ||
690 | |||
691 | __rq = cfq_find_rq_hash(cfqd, bio->bi_sector); | 677 | __rq = cfq_find_rq_hash(cfqd, bio->bi_sector); |
692 | if (__rq && elv_rq_merge_ok(__rq, bio)) { | 678 | if (__rq && elv_rq_merge_ok(__rq, bio)) { |
693 | ret = ELEVATOR_BACK_MERGE; | 679 | ret = ELEVATOR_BACK_MERGE; |
@@ -702,8 +688,6 @@ cfq_merge(request_queue_t *q, struct request **req, struct bio *bio) | |||
702 | 688 | ||
703 | return ELEVATOR_NO_MERGE; | 689 | return ELEVATOR_NO_MERGE; |
704 | out: | 690 | out: |
705 | q->last_merge = __rq; | ||
706 | out_insert: | ||
707 | *req = __rq; | 691 | *req = __rq; |
708 | return ret; | 692 | return ret; |
709 | } | 693 | } |
@@ -722,8 +706,6 @@ static void cfq_merged_request(request_queue_t *q, struct request *req) | |||
722 | cfq_update_next_crq(crq); | 706 | cfq_update_next_crq(crq); |
723 | cfq_reposition_crq_rb(cfqq, crq); | 707 | cfq_reposition_crq_rb(cfqq, crq); |
724 | } | 708 | } |
725 | |||
726 | q->last_merge = req; | ||
727 | } | 709 | } |
728 | 710 | ||
729 | static void | 711 | static void |
@@ -1670,13 +1652,9 @@ static void cfq_insert_request(request_queue_t *q, struct request *rq) | |||
1670 | 1652 | ||
1671 | list_add_tail(&rq->queuelist, &cfqq->fifo); | 1653 | list_add_tail(&rq->queuelist, &cfqq->fifo); |
1672 | 1654 | ||
1673 | if (rq_mergeable(rq)) { | 1655 | if (rq_mergeable(rq)) |
1674 | cfq_add_crq_hash(cfqd, crq); | 1656 | cfq_add_crq_hash(cfqd, crq); |
1675 | 1657 | ||
1676 | if (!cfqd->queue->last_merge) | ||
1677 | cfqd->queue->last_merge = rq; | ||
1678 | } | ||
1679 | |||
1680 | cfq_crq_enqueued(cfqd, cfqq, crq); | 1658 | cfq_crq_enqueued(cfqd, cfqq, crq); |
1681 | } | 1659 | } |
1682 | 1660 | ||