[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 <jens.axboe@oracle.com>
This commit is contained in:
Родитель
2985259b0e
Коммит
1aa4f24fe9
|
@ -1405,8 +1405,7 @@ static inline int ll_new_hw_segment(request_queue_t *q,
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ll_back_merge_fn(request_queue_t *q, struct request *req,
|
int ll_back_merge_fn(request_queue_t *q, struct request *req, struct bio *bio)
|
||||||
struct bio *bio)
|
|
||||||
{
|
{
|
||||||
unsigned short max_sectors;
|
unsigned short max_sectors;
|
||||||
int len;
|
int len;
|
||||||
|
@ -1442,6 +1441,7 @@ static int ll_back_merge_fn(request_queue_t *q, struct request *req,
|
||||||
|
|
||||||
return ll_new_hw_segment(q, req, bio);
|
return ll_new_hw_segment(q, req, bio);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL(ll_back_merge_fn);
|
||||||
|
|
||||||
static int ll_front_merge_fn(request_queue_t *q, struct request *req,
|
static int ll_front_merge_fn(request_queue_t *q, struct request *req,
|
||||||
struct bio *bio)
|
struct bio *bio)
|
||||||
|
@ -1912,9 +1912,6 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
q->request_fn = rfn;
|
q->request_fn = rfn;
|
||||||
q->back_merge_fn = ll_back_merge_fn;
|
|
||||||
q->front_merge_fn = ll_front_merge_fn;
|
|
||||||
q->merge_requests_fn = ll_merge_requests_fn;
|
|
||||||
q->prep_rq_fn = NULL;
|
q->prep_rq_fn = NULL;
|
||||||
q->unplug_fn = generic_unplug_device;
|
q->unplug_fn = generic_unplug_device;
|
||||||
q->queue_flags = (1 << QUEUE_FLAG_CLUSTER);
|
q->queue_flags = (1 << QUEUE_FLAG_CLUSTER);
|
||||||
|
@ -2371,7 +2368,7 @@ static int __blk_rq_map_user(request_queue_t *q, struct request *rq,
|
||||||
spin_lock_irq(q->queue_lock);
|
spin_lock_irq(q->queue_lock);
|
||||||
if (!rq->bio)
|
if (!rq->bio)
|
||||||
blk_rq_bio_prep(q, rq, bio);
|
blk_rq_bio_prep(q, rq, bio);
|
||||||
else if (!q->back_merge_fn(q, rq, bio)) {
|
else if (!ll_back_merge_fn(q, rq, bio)) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
spin_unlock_irq(q->queue_lock);
|
spin_unlock_irq(q->queue_lock);
|
||||||
goto unmap_bio;
|
goto unmap_bio;
|
||||||
|
@ -2820,7 +2817,7 @@ static int attempt_merge(request_queue_t *q, struct request *req,
|
||||||
* will have updated segment counts, update sector
|
* will have updated segment counts, update sector
|
||||||
* counts here.
|
* counts here.
|
||||||
*/
|
*/
|
||||||
if (!q->merge_requests_fn(q, req, next))
|
if (!ll_merge_requests_fn(q, req, next))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2937,7 +2934,7 @@ static int __make_request(request_queue_t *q, struct bio *bio)
|
||||||
case ELEVATOR_BACK_MERGE:
|
case ELEVATOR_BACK_MERGE:
|
||||||
BUG_ON(!rq_mergeable(req));
|
BUG_ON(!rq_mergeable(req));
|
||||||
|
|
||||||
if (!q->back_merge_fn(q, req, bio))
|
if (!ll_back_merge_fn(q, req, bio))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE);
|
blk_add_trace_bio(q, bio, BLK_TA_BACKMERGE);
|
||||||
|
@ -2954,7 +2951,7 @@ static int __make_request(request_queue_t *q, struct bio *bio)
|
||||||
case ELEVATOR_FRONT_MERGE:
|
case ELEVATOR_FRONT_MERGE:
|
||||||
BUG_ON(!rq_mergeable(req));
|
BUG_ON(!rq_mergeable(req));
|
||||||
|
|
||||||
if (!q->front_merge_fn(q, req, bio))
|
if (!ll_front_merge_fn(q, req, bio))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE);
|
blk_add_trace_bio(q, bio, BLK_TA_FRONTMERGE);
|
||||||
|
|
|
@ -265,7 +265,7 @@ static int scsi_merge_bio(struct request *rq, struct bio *bio)
|
||||||
|
|
||||||
if (!rq->bio)
|
if (!rq->bio)
|
||||||
blk_rq_bio_prep(q, rq, bio);
|
blk_rq_bio_prep(q, rq, bio);
|
||||||
else if (!q->back_merge_fn(q, rq, bio))
|
else if (!ll_back_merge_fn(q, rq, bio))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
else {
|
else {
|
||||||
rq->biotail->bi_next = bio;
|
rq->biotail->bi_next = bio;
|
||||||
|
|
|
@ -331,10 +331,6 @@ struct request_pm_state
|
||||||
|
|
||||||
#include <linux/elevator.h>
|
#include <linux/elevator.h>
|
||||||
|
|
||||||
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 void (request_fn_proc) (request_queue_t *q);
|
||||||
typedef int (make_request_fn) (request_queue_t *q, struct bio *bio);
|
typedef int (make_request_fn) (request_queue_t *q, struct bio *bio);
|
||||||
typedef int (prep_rq_fn) (request_queue_t *, struct request *);
|
typedef int (prep_rq_fn) (request_queue_t *, struct request *);
|
||||||
|
@ -376,9 +372,6 @@ struct request_queue
|
||||||
struct request_list rq;
|
struct request_list rq;
|
||||||
|
|
||||||
request_fn_proc *request_fn;
|
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;
|
make_request_fn *make_request_fn;
|
||||||
prep_rq_fn *prep_rq_fn;
|
prep_rq_fn *prep_rq_fn;
|
||||||
unplug_fn *unplug_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 *,
|
extern int sg_scsi_ioctl(struct file *, struct request_queue *,
|
||||||
struct gendisk *, struct scsi_ioctl_command __user *);
|
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
|
* 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
|
* congested queues, and wake up anyone who was waiting for requests to be
|
||||||
|
|
Загрузка…
Ссылка в новой задаче