aboutsummaryrefslogtreecommitdiffstats
path: root/block/elevator.c
diff options
context:
space:
mode:
authorJens Axboe <jaxboe@fusionio.com>2011-03-30 03:52:30 -0400
committerJens Axboe <jaxboe@fusionio.com>2011-04-05 17:51:37 -0400
commitb710a480554f2be682bac3cb59b0e085ba3d644b (patch)
treebd1b9d5080bca2b35c861ddbc98d4116445bebfb /block/elevator.c
parent8182924bc5850281985d73c312876746acd390b5 (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>
Diffstat (limited to 'block/elevator.c')
-rw-r--r--block/elevator.c35
1 files changed, 15 insertions, 20 deletions
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
616void elv_drain_elevator(struct request_queue *q) 616void 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
658void elv_insert(struct request_queue *q, struct request *rq, int where) 658void __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
726void __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}
743EXPORT_SYMBOL(__elv_add_request); 738EXPORT_SYMBOL(__elv_add_request);
744 739
745void elv_add_request(struct request_queue *q, struct request *rq, int where) 740void elv_add_request(struct request_queue *q, struct request *rq, int where)