diff options
| author | Jens Axboe <jaxboe@fusionio.com> | 2011-03-30 03:52:30 -0400 |
|---|---|---|
| committer | Jens Axboe <jaxboe@fusionio.com> | 2011-04-05 17:51:37 -0400 |
| commit | b710a480554f2be682bac3cb59b0e085ba3d644b (patch) | |
| tree | bd1b9d5080bca2b35c861ddbc98d4116445bebfb | |
| parent | 8182924bc5850281985d73c312876746acd390b5 (diff) | |
block: get rid of elv_insert() interface
Merge it with __elv_add_request(), it's pretty pointless to
have a function with only two callers. The main interface
is elv_add_request()/__elv_add_request().
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
| -rw-r--r-- | block/blk-flush.c | 4 | ||||
| -rw-r--r-- | block/elevator.c | 35 | ||||
| -rw-r--r-- | include/linux/elevator.h | 1 |
3 files changed, 17 insertions, 23 deletions
diff --git a/block/blk-flush.c b/block/blk-flush.c index 93d5fd8e51eb..d6275cbbaf35 100644 --- a/block/blk-flush.c +++ b/block/blk-flush.c | |||
| @@ -261,7 +261,7 @@ static bool blk_kick_flush(struct request_queue *q) | |||
| 261 | q->flush_rq.end_io = flush_end_io; | 261 | q->flush_rq.end_io = flush_end_io; |
| 262 | 262 | ||
| 263 | q->flush_pending_idx ^= 1; | 263 | q->flush_pending_idx ^= 1; |
| 264 | elv_insert(q, &q->flush_rq, ELEVATOR_INSERT_REQUEUE); | 264 | __elv_add_request(q, &q->flush_rq, ELEVATOR_INSERT_REQUEUE); |
| 265 | return true; | 265 | return true; |
| 266 | } | 266 | } |
| 267 | 267 | ||
| @@ -281,7 +281,7 @@ static void flush_data_end_io(struct request *rq, int error) | |||
| 281 | * blk_insert_flush - insert a new FLUSH/FUA request | 281 | * blk_insert_flush - insert a new FLUSH/FUA request |
| 282 | * @rq: request to insert | 282 | * @rq: request to insert |
| 283 | * | 283 | * |
| 284 | * To be called from elv_insert() for %ELEVATOR_INSERT_FLUSH insertions. | 284 | * To be called from __elv_add_request() for %ELEVATOR_INSERT_FLUSH insertions. |
| 285 | * @rq is being submitted. Analyze what needs to be done and put it on the | 285 | * @rq is being submitted. Analyze what needs to be done and put it on the |
| 286 | * right queue. | 286 | * right queue. |
| 287 | * | 287 | * |
diff --git a/block/elevator.c b/block/elevator.c index c387d3168734..0cdb4e7ebab4 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
| @@ -610,7 +610,7 @@ void elv_requeue_request(struct request_queue *q, struct request *rq) | |||
| 610 | 610 | ||
| 611 | rq->cmd_flags &= ~REQ_STARTED; | 611 | rq->cmd_flags &= ~REQ_STARTED; |
| 612 | 612 | ||
| 613 | elv_insert(q, rq, ELEVATOR_INSERT_REQUEUE); | 613 | __elv_add_request(q, rq, ELEVATOR_INSERT_REQUEUE); |
| 614 | } | 614 | } |
| 615 | 615 | ||
| 616 | void elv_drain_elevator(struct request_queue *q) | 616 | void elv_drain_elevator(struct request_queue *q) |
| @@ -655,12 +655,25 @@ void elv_quiesce_end(struct request_queue *q) | |||
| 655 | queue_flag_clear(QUEUE_FLAG_ELVSWITCH, q); | 655 | queue_flag_clear(QUEUE_FLAG_ELVSWITCH, q); |
| 656 | } | 656 | } |
| 657 | 657 | ||
| 658 | void elv_insert(struct request_queue *q, struct request *rq, int where) | 658 | void __elv_add_request(struct request_queue *q, struct request *rq, int where) |
| 659 | { | 659 | { |
| 660 | trace_block_rq_insert(q, rq); | 660 | trace_block_rq_insert(q, rq); |
| 661 | 661 | ||
| 662 | rq->q = q; | 662 | rq->q = q; |
| 663 | 663 | ||
| 664 | BUG_ON(rq->cmd_flags & REQ_ON_PLUG); | ||
| 665 | |||
| 666 | if (rq->cmd_flags & REQ_SOFTBARRIER) { | ||
| 667 | /* barriers are scheduling boundary, update end_sector */ | ||
| 668 | if (rq->cmd_type == REQ_TYPE_FS || | ||
| 669 | (rq->cmd_flags & REQ_DISCARD)) { | ||
| 670 | q->end_sector = rq_end_sector(rq); | ||
| 671 | q->boundary_rq = rq; | ||
| 672 | } | ||
| 673 | } else if (!(rq->cmd_flags & REQ_ELVPRIV) && | ||
| 674 | where == ELEVATOR_INSERT_SORT) | ||
| 675 | where = ELEVATOR_INSERT_BACK; | ||
| 676 | |||
| 664 | switch (where) { | 677 | switch (where) { |
| 665 | case ELEVATOR_INSERT_REQUEUE: | 678 | case ELEVATOR_INSERT_REQUEUE: |
| 666 | case ELEVATOR_INSERT_FRONT: | 679 | case ELEVATOR_INSERT_FRONT: |
| @@ -722,24 +735,6 @@ void elv_insert(struct request_queue *q, struct request *rq, int where) | |||
| 722 | BUG(); | 735 | BUG(); |
| 723 | } | 736 | } |
| 724 | } | 737 | } |
| 725 | |||
| 726 | void __elv_add_request(struct request_queue *q, struct request *rq, int where) | ||
| 727 | { | ||
| 728 | BUG_ON(rq->cmd_flags & REQ_ON_PLUG); | ||
| 729 | |||
| 730 | if (rq->cmd_flags & REQ_SOFTBARRIER) { | ||
| 731 | /* barriers are scheduling boundary, update end_sector */ | ||
| 732 | if (rq->cmd_type == REQ_TYPE_FS || | ||
| 733 | (rq->cmd_flags & REQ_DISCARD)) { | ||
| 734 | q->end_sector = rq_end_sector(rq); | ||
| 735 | q->boundary_rq = rq; | ||
| 736 | } | ||
| 737 | } else if (!(rq->cmd_flags & REQ_ELVPRIV) && | ||
| 738 | where == ELEVATOR_INSERT_SORT) | ||
| 739 | where = ELEVATOR_INSERT_BACK; | ||
| 740 | |||
| 741 | elv_insert(q, rq, where); | ||
| 742 | } | ||
| 743 | EXPORT_SYMBOL(__elv_add_request); | 738 | EXPORT_SYMBOL(__elv_add_request); |
| 744 | 739 | ||
| 745 | void elv_add_request(struct request_queue *q, struct request *rq, int where) | 740 | void elv_add_request(struct request_queue *q, struct request *rq, int where) |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index d93efcc44570..21a8ebf2dc3a 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
| @@ -101,7 +101,6 @@ extern void elv_dispatch_sort(struct request_queue *, struct request *); | |||
| 101 | extern void elv_dispatch_add_tail(struct request_queue *, struct request *); | 101 | extern void elv_dispatch_add_tail(struct request_queue *, struct request *); |
| 102 | extern void elv_add_request(struct request_queue *, struct request *, int); | 102 | extern void elv_add_request(struct request_queue *, struct request *, int); |
| 103 | extern void __elv_add_request(struct request_queue *, struct request *, int); | 103 | extern void __elv_add_request(struct request_queue *, struct request *, int); |
| 104 | extern void elv_insert(struct request_queue *, struct request *, int); | ||
| 105 | extern int elv_merge(struct request_queue *, struct request **, struct bio *); | 104 | extern int elv_merge(struct request_queue *, struct request **, struct bio *); |
| 106 | extern int elv_try_merge(struct request *, struct bio *); | 105 | extern int elv_try_merge(struct request *, struct bio *); |
| 107 | extern void elv_merge_requests(struct request_queue *, struct request *, | 106 | extern void elv_merge_requests(struct request_queue *, struct request *, |
