diff options
-rw-r--r-- | block/ll_rw_blk.c | 15 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 2 | ||||
-rw-r--r-- | include/linux/blkdev.h | 12 |
3 files changed, 12 insertions, 17 deletions
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index 71a78a7e42fd..433797934bd5 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -1405,8 +1405,7 @@ static inline int ll_new_hw_segment(request_queue_t *q, | |||
1405 | return 1; | 1405 | return 1; |
1406 | } | 1406 | } |
1407 | 1407 | ||
1408 | static int ll_back_merge_fn(request_queue_t *q, struct request *req, | 1408 | int ll_back_merge_fn(request_queue_t *q, struct request *req, struct bio *bio) |
1409 | struct bio *bio) | ||
1410 | { | 1409 | { |
1411 | unsigned short max_sectors; | 1410 | unsigned short max_sectors; |
1412 | int len; | 1411 | int len; |
@@ -1442,6 +1441,7 @@ static int ll_back_merge_fn(request_queue_t *q, struct request *req, | |||
1442 | 1441 | ||
1443 | return ll_new_hw_segment(q, req, bio); | 1442 | return ll_new_hw_segment(q, req, bio); |
1444 | } | 1443 | } |
1444 | EXPORT_SYMBOL(ll_back_merge_fn); | ||
1445 | 1445 | ||
1446 | static int ll_front_merge_fn(request_queue_t *q, struct request *req, | 1446 | static int ll_front_merge_fn(request_queue_t *q, struct request *req, |
1447 | struct bio *bio) | 1447 | struct bio *bio) |
@@ -1912,9 +1912,6 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id) | |||
1912 | } | 1912 | } |
1913 | 1913 | ||
1914 | q->request_fn = rfn; | 1914 | q->request_fn = rfn; |
1915 | q->back_merge_fn = ll_back_merge_fn; | ||
1916 | q->front_merge_fn = ll_front_merge_fn; | ||
1917 | q->merge_requests_fn = ll_merge_requests_fn; | ||
1918 | q->prep_rq_fn = NULL; | 1915 | q->prep_rq_fn = NULL; |
1919 | q->unplug_fn = generic_unplug_device; | 1916 | q->unplug_fn = generic_unplug_device; |
1920 | q->queue_flags = (1 << QUEUE_FLAG_CLUSTER); | 1917 | q->queue_flags = (1 << QUEUE_FLAG_CLUSTER); |
@@ -2371,7 +2368,7 @@ static int __blk_rq_map_user(request_queue_t *q, struct request *rq, | |||
2371 | spin_lock_irq(q->queue_lock); | 2368 | spin_lock_irq(q->queue_lock); |
2372 | if (!rq->bio) | 2369 | if (!rq->bio) |
2373 | blk_rq_bio_prep(q, rq, bio); | 2370 | blk_rq_bio_prep(q, rq, bio); |
2374 | else if (!q->back_merge_fn(q, rq, bio)) { | 2371 | else if (!ll_back_merge_fn(q, rq, bio)) { |
2375 | ret = -EINVAL; | 2372 | ret = -EINVAL; |
2376 | spin_unlock_irq(q->queue_lock); | 2373 | spin_unlock_irq(q->queue_lock); |
2377 | goto unmap_bio; | 2374 | goto unmap_bio; |
@@ -2820,7 +2817,7 @@ static int attempt_merge(request_queue_t *q, struct request *req, | |||
2820 | * will have updated segment counts, update sector | 2817 | * will have updated segment counts, update sector |
2821 | * counts here. | 2818 | * counts here. |
2822 | */ | 2819 | */ |
2823 | if (!q->merge_requests_fn(q, req, next)) | 2820 | if (!ll_merge_requests_fn(q, req, next)) |
2824 | return 0; | 2821 | return 0; |
2825 | 2822 | ||
2826 | /* | 2823 | /* |
@@ -2937,7 +2934,7 @@ static int __make_request(request_queue_t *q, struct bio *bio) | |||
2937 | case ELEVATOR_BACK_MERGE: | 2934 | case ELEVATOR_BACK_MERGE: |
2938 | BUG_ON(!rq_mergeable(req)); | 2935 | BUG_ON(!rq_mergeable(req)); |
2939 | 2936 | ||
2940 | if (!q->back_merge_fn(q, req, bio)) | 2937 | if (!ll_back_merge_fn(q, req, bio)) |
2941 | break; | 2938 | break; |
2942 | 2939 | ||
2943 | blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE); | 2940 | blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE); |
@@ -2954,7 +2951,7 @@ static int __make_request(request_queue_t *q, struct bio *bio) | |||
2954 | case ELEVATOR_FRONT_MERGE: | 2951 | case ELEVATOR_FRONT_MERGE: |
2955 | BUG_ON(!rq_mergeable(req)); | 2952 | BUG_ON(!rq_mergeable(req)); |
2956 | 2953 | ||
2957 | if (!q->front_merge_fn(q, req, bio)) | 2954 | if (!ll_front_merge_fn(q, req, bio)) |
2958 | break; | 2955 | break; |
2959 | 2956 | ||
2960 | blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE); | 2957 | blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE); |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 41a2ea32a300..f02f48a882a9 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -265,7 +265,7 @@ static int scsi_merge_bio(struct request *rq, struct bio *bio) | |||
265 | 265 | ||
266 | if (!rq->bio) | 266 | if (!rq->bio) |
267 | blk_rq_bio_prep(q, rq, bio); | 267 | blk_rq_bio_prep(q, rq, bio); |
268 | else if (!q->back_merge_fn(q, rq, bio)) | 268 | else if (!ll_back_merge_fn(q, rq, bio)) |
269 | return -EINVAL; | 269 | return -EINVAL; |
270 | else { | 270 | else { |
271 | rq->biotail->bi_next = bio; | 271 | rq->biotail->bi_next = bio; |
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 | |||
331 | 331 | ||
332 | #include <linux/elevator.h> | 332 | #include <linux/elevator.h> |
333 | 333 | ||
334 | typedef int (merge_request_fn) (request_queue_t *, struct request *, | ||
335 | struct bio *); | ||
336 | typedef int (merge_requests_fn) (request_queue_t *, struct request *, | ||
337 | struct request *); | ||
338 | typedef void (request_fn_proc) (request_queue_t *q); | 334 | typedef void (request_fn_proc) (request_queue_t *q); |
339 | typedef int (make_request_fn) (request_queue_t *q, struct bio *bio); | 335 | typedef int (make_request_fn) (request_queue_t *q, struct bio *bio); |
340 | typedef int (prep_rq_fn) (request_queue_t *, struct request *); | 336 | typedef int (prep_rq_fn) (request_queue_t *, struct request *); |
@@ -376,9 +372,6 @@ struct request_queue | |||
376 | struct request_list rq; | 372 | struct request_list rq; |
377 | 373 | ||
378 | request_fn_proc *request_fn; | 374 | request_fn_proc *request_fn; |
379 | merge_request_fn *back_merge_fn; | ||
380 | merge_request_fn *front_merge_fn; | ||
381 | merge_requests_fn *merge_requests_fn; | ||
382 | make_request_fn *make_request_fn; | 375 | make_request_fn *make_request_fn; |
383 | prep_rq_fn *prep_rq_fn; | 376 | prep_rq_fn *prep_rq_fn; |
384 | unplug_fn *unplug_fn; | 377 | unplug_fn *unplug_fn; |
@@ -649,6 +642,11 @@ extern int sg_scsi_ioctl(struct file *, struct request_queue *, | |||
649 | struct gendisk *, struct scsi_ioctl_command __user *); | 642 | struct gendisk *, struct scsi_ioctl_command __user *); |
650 | 643 | ||
651 | /* | 644 | /* |
645 | * Temporary export, until SCSI gets fixed up. | ||
646 | */ | ||
647 | extern int ll_back_merge_fn(request_queue_t *, struct request *, struct bio *); | ||
648 | |||
649 | /* | ||
652 | * A queue has just exitted congestion. Note this in the global counter of | 650 | * A queue has just exitted congestion. Note this in the global counter of |
653 | * congested queues, and wake up anyone who was waiting for requests to be | 651 | * congested queues, and wake up anyone who was waiting for requests to be |
654 | * put back. | 652 | * put back. |