>From eb158393a5fd2eec0582bbba8af588be7e08ef32 Mon Sep 17 00:00:00 2001 From: Alan D. Brunelle Date: Fri, 25 Apr 2008 07:14:42 -0400 Subject: [PATCH] Enables back-merge checks (and one-hit cache checks) for merges Undoes patch 3/3 -- puts rqs onto the rq_hash list -- and performs simple hash list checks for back-merges only. Signed-off-by: Alan D. Brunelle --- block/elevator.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/elevator.c b/block/elevator.c index 557ee38..59be58d 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -488,9 +488,6 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio) } } - if (blk_queue_nomerges(q)) - return ELEVATOR_NO_MERGE; - /* * See if our hash lookup can find a potential backmerge. */ @@ -500,6 +497,9 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio) return ELEVATOR_BACK_MERGE; } + if (blk_queue_nomerges(q)) + return ELEVATOR_NO_MERGE; + if (e->ops->elevator_merge_fn) return e->ops->elevator_merge_fn(q, req, bio); @@ -604,7 +604,7 @@ void elv_insert(struct request_queue *q, struct request *rq, int where) BUG_ON(!blk_fs_request(rq)); rq->cmd_flags |= REQ_SORTED; q->nr_sorted++; - if (!blk_queue_nomerges(q) && rq_mergeable(rq)) { + if (rq_mergeable(rq)) { elv_rqhash_add(q, rq); if (!q->last_merge) q->last_merge = rq; -- 1.5.2.5