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>

+17 -23
+2 -2
block/blk-flush.c
··· 261 261 q->flush_rq.end_io = flush_end_io; 262 262 263 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 265 return true; 266 266 } 267 267 ··· 281 281 * blk_insert_flush - insert a new FLUSH/FUA request 282 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 285 * @rq is being submitted. Analyze what needs to be done and put it on the 286 286 * right queue. 287 287 *
+15 -20
block/elevator.c
··· 610 610 611 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 616 void elv_drain_elevator(struct request_queue *q) ··· 655 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 660 trace_block_rq_insert(q, rq); 661 661 662 662 rq->q = q; 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; 663 676 664 677 switch (where) { 665 678 case ELEVATOR_INSERT_REQUEUE: ··· 734 721 __func__, where); 735 722 BUG(); 736 723 } 737 - } 738 - 739 - void __elv_add_request(struct request_queue *q, struct request *rq, int where) 740 - { 741 - BUG_ON(rq->cmd_flags & REQ_ON_PLUG); 742 - 743 - if (rq->cmd_flags & REQ_SOFTBARRIER) { 744 - /* barriers are scheduling boundary, update end_sector */ 745 - if (rq->cmd_type == REQ_TYPE_FS || 746 - (rq->cmd_flags & REQ_DISCARD)) { 747 - q->end_sector = rq_end_sector(rq); 748 - q->boundary_rq = rq; 749 - } 750 - } else if (!(rq->cmd_flags & REQ_ELVPRIV) && 751 - where == ELEVATOR_INSERT_SORT) 752 - where = ELEVATOR_INSERT_BACK; 753 - 754 - elv_insert(q, rq, where); 755 724 } 756 725 EXPORT_SYMBOL(__elv_add_request); 757 726
-1
include/linux/elevator.h
··· 101 101 extern void elv_dispatch_add_tail(struct request_queue *, struct request *); 102 102 extern void elv_add_request(struct request_queue *, struct request *, int); 103 103 extern void __elv_add_request(struct request_queue *, struct request *, int); 104 - extern void elv_insert(struct request_queue *, struct request *, int); 105 104 extern int elv_merge(struct request_queue *, struct request **, struct bio *); 106 105 extern int elv_try_merge(struct request *, struct bio *); 107 106 extern void elv_merge_requests(struct request_queue *, struct request *,