From 1aa4f24fe96938cabe7a1e9da8bc3bfbd1dfe3fa Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 19 Dec 2006 08:33:11 +0100 Subject: [PATCH] Remove queue merging hooks We have full flexibility of merging parameters now, so we can remove the hooks that define back/front/request merge strategies. Nobody is using them anymore. Signed-off-by: Jens Axboe --- include/linux/blkdev.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'include') diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ea330d7b46c0..0fa33017ec02 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -331,10 +331,6 @@ struct request_pm_state #include -typedef int (merge_request_fn) (request_queue_t *, struct request *, - struct bio *); -typedef int (merge_requests_fn) (request_queue_t *, struct request *, - struct request *); typedef void (request_fn_proc) (request_queue_t *q); typedef int (make_request_fn) (request_queue_t *q, struct bio *bio); typedef int (prep_rq_fn) (request_queue_t *, struct request *); @@ -376,9 +372,6 @@ struct request_queue struct request_list rq; request_fn_proc *request_fn; - merge_request_fn *back_merge_fn; - merge_request_fn *front_merge_fn; - merge_requests_fn *merge_requests_fn; make_request_fn *make_request_fn; prep_rq_fn *prep_rq_fn; unplug_fn *unplug_fn; @@ -648,6 +641,11 @@ extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __ extern int sg_scsi_ioctl(struct file *, struct request_queue *, struct gendisk *, struct scsi_ioctl_command __user *); +/* + * Temporary export, until SCSI gets fixed up. + */ +extern int ll_back_merge_fn(request_queue_t *, struct request *, struct bio *); + /* * A queue has just exitted congestion. Note this in the global counter of * congested queues, and wake up anyone who was waiting for requests to be -- cgit v1.2.1 From 8e5cfc45e7527eb5c8a9a22d56a7b9227e7c0913 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 19 Dec 2006 11:12:46 +0100 Subject: [PATCH] Fixup blk_rq_unmap_user() API The blk_rq_unmap_user() API is not very nice. It expects the caller to know that rq->bio has to be reset to the original bio, and it will silently do nothing if that is not done. Instead make it explicit that we need to pass in the first bio, by expecting a bio argument. Signed-off-by: Jens Axboe --- include/linux/blkdev.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0fa33017ec02..36a6eacefe20 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -672,7 +672,7 @@ extern void __blk_stop_queue(request_queue_t *q); extern void blk_run_queue(request_queue_t *); extern void blk_start_queueing(request_queue_t *); extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long); -extern int blk_rq_unmap_user(struct request *); +extern int blk_rq_unmap_user(struct bio *); extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int, unsigned int); -- cgit v1.2.1 From da775265021b61d5eb81df155e36cb0810f6df53 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Wed, 20 Dec 2006 11:04:12 +0100 Subject: [PATCH] cfq-iosched: don't allow sync merges across queues Currently we allow any merge, even if the io originates from different processes. This can cause really bad starvation and unfairness, if those ios happen to be synchronous (reads or direct writes). So add a allow_merge hook to the io scheduler ops, so an io scheduler can help decide whether a bio/process combination may be merged with an existing request. Signed-off-by: Jens Axboe --- include/linux/elevator.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/linux/elevator.h b/include/linux/elevator.h index a24931d24404..e88fcbc77f8f 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -12,6 +12,8 @@ typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struc typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int); +typedef int (elevator_allow_merge_fn) (request_queue_t *, struct request *, struct bio *); + typedef int (elevator_dispatch_fn) (request_queue_t *, int); typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); @@ -33,6 +35,7 @@ struct elevator_ops elevator_merge_fn *elevator_merge_fn; elevator_merged_fn *elevator_merged_fn; elevator_merge_req_fn *elevator_merge_req_fn; + elevator_allow_merge_fn *elevator_allow_merge_fn; elevator_dispatch_fn *elevator_dispatch_fn; elevator_add_req_fn *elevator_add_req_fn; -- cgit v1.2.1