aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/blkdev.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-07-28 03:23:08 -0400
committerJens Axboe <axboe@nelson.home.kernel.dk>2006-09-30 14:26:56 -0400
commit9817064b68fef7e4580c6df1ea597e106b9ff88b (patch)
tree76c27990626247613e9efa45b792d51ad79635d7 /include/linux/blkdev.h
parent4aff5e2333c9a1609662f2091f55c3f6fffdad36 (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 'include/linux/blkdev.h')
-rw-r--r--include/linux/blkdev.h17
1 files changed, 2 insertions, 15 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index b2a412cf468f..8f5486964671 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -229,6 +229,8 @@ struct request {
229 struct bio *bio; 229 struct bio *bio;
230 struct bio *biotail; 230 struct bio *biotail;
231 231
232 struct hlist_node hash; /* merge hash */
233
232 void *elevator_private; 234 void *elevator_private;
233 void *completion_data; 235 void *completion_data;
234 236
@@ -697,21 +699,6 @@ static inline void blkdev_dequeue_request(struct request *req)
697} 699}
698 700
699/* 701/*
700 * This should be in elevator.h, but that requires pulling in rq and q
701 */
702static inline void elv_dispatch_add_tail(struct request_queue *q,
703 struct request *rq)
704{
705 if (q->last_merge == rq)
706 q->last_merge = NULL;
707 q->nr_sorted--;
708
709 q->end_sector = rq_end_sector(rq);
710 q->boundary_rq = rq;
711 list_add_tail(&rq->queuelist, &q->queue_head);
712}
713
714/*
715 * Access functions for manipulating queue properties 702 * Access functions for manipulating queue properties
716 */ 703 */
717extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, 704extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn,