summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2002-09-26 18:39:15 -0700
committerJens Axboe <axboe@suse.de>2002-09-26 18:39:15 -0700
commit33fb2ab558d9463ee3f1b22a07117cd49d3a40b2 (patch)
tree683f6505bbd7f81a0d557bb4c214670d039aaa1d /include
parent14fc589bb07155396ac0a19f4e081f4c6c2552ef (diff)
[PATCH] io scheduler update
This fixes a problem with the deadline io scheduler, if the correct insertion point is at the front of the list. This is something that we never have gotten right in 2.4 either. The problem is that the elevator merge function has to return a pointer to a struct request, and for front insert we really have to return the head of the list which cannot be expressed as a request of course. The real issue is that the elevator_merge function actually performs two functions - it scans for a merge, and if it can't find any, it selects and insertion point. It's done this way for efficiency reasons, even if the design isn't all that clean. So we change the io scheduler merge functions to get passed a pointer to a list_head pointer instead. This works for both inserts and merges. In addition, deadline checks if it really should insert at the very front. Also don't pass in request to elv_try_last_merge(), the very name of the function suggests that it's q->last_merge that we are interested in.
Diffstat (limited to 'include')
-rw-r--r--include/linux/elevator.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index b18faeef9955..5c6c7db6e97e 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -1,7 +1,7 @@
#ifndef _LINUX_ELEVATOR_H
#define _LINUX_ELEVATOR_H
-typedef int (elevator_merge_fn) (request_queue_t *, struct request **,
+typedef int (elevator_merge_fn) (request_queue_t *, struct list_head **,
struct bio *);
typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *);
@@ -42,7 +42,7 @@ struct elevator_s
*/
extern void __elv_add_request(request_queue_t *, struct request *,
struct list_head *);
-extern int elv_merge(request_queue_t *, struct request **, struct bio *);
+extern int elv_merge(request_queue_t *, struct list_head **, struct bio *);
extern void elv_merge_requests(request_queue_t *, struct request *,
struct request *);
extern void elv_merged_request(request_queue_t *, struct request *);
@@ -78,7 +78,7 @@ extern void elevator_exit(request_queue_t *, elevator_t *);
extern inline int bio_rq_in_between(struct bio *, struct request *, struct list_head *);
extern inline int elv_rq_merge_ok(struct request *, struct bio *);
extern inline int elv_try_merge(struct request *, struct bio *);
-extern inline int elv_try_last_merge(request_queue_t *, struct request **, struct bio *);
+extern inline int elv_try_last_merge(request_queue_t *, struct bio *);
/*
* Return values from elevator merger