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().
···261261 q->flush_rq.end_io = flush_end_io;262262263263 q->flush_pending_idx ^= 1;264264- elv_insert(q, &q->flush_rq, ELEVATOR_INSERT_REQUEUE);264264+ __elv_add_request(q, &q->flush_rq, ELEVATOR_INSERT_REQUEUE);265265 return true;266266}267267···281281 * blk_insert_flush - insert a new FLUSH/FUA request282282 * @rq: request to insert283283 *284284- * To be called from elv_insert() for %ELEVATOR_INSERT_FLUSH insertions.284284+ * To be called from __elv_add_request() for %ELEVATOR_INSERT_FLUSH insertions.285285 * @rq is being submitted. Analyze what needs to be done and put it on the286286 * right queue.287287 *
+15-20
block/elevator.c
···610610611611 rq->cmd_flags &= ~REQ_STARTED;612612613613- elv_insert(q, rq, ELEVATOR_INSERT_REQUEUE);613613+ __elv_add_request(q, rq, ELEVATOR_INSERT_REQUEUE);614614}615615616616void elv_drain_elevator(struct request_queue *q)···655655 queue_flag_clear(QUEUE_FLAG_ELVSWITCH, q);656656}657657658658-void elv_insert(struct request_queue *q, struct request *rq, int where)658658+void __elv_add_request(struct request_queue *q, struct request *rq, int where)659659{660660 trace_block_rq_insert(q, rq);661661662662 rq->q = q;663663+664664+ BUG_ON(rq->cmd_flags & REQ_ON_PLUG);665665+666666+ if (rq->cmd_flags & REQ_SOFTBARRIER) {667667+ /* barriers are scheduling boundary, update end_sector */668668+ if (rq->cmd_type == REQ_TYPE_FS ||669669+ (rq->cmd_flags & REQ_DISCARD)) {670670+ q->end_sector = rq_end_sector(rq);671671+ q->boundary_rq = rq;672672+ }673673+ } else if (!(rq->cmd_flags & REQ_ELVPRIV) &&674674+ where == ELEVATOR_INSERT_SORT)675675+ where = ELEVATOR_INSERT_BACK;663676664677 switch (where) {665678 case ELEVATOR_INSERT_REQUEUE:···734721 __func__, where);735722 BUG();736723 }737737-}738738-739739-void __elv_add_request(struct request_queue *q, struct request *rq, int where)740740-{741741- BUG_ON(rq->cmd_flags & REQ_ON_PLUG);742742-743743- if (rq->cmd_flags & REQ_SOFTBARRIER) {744744- /* barriers are scheduling boundary, update end_sector */745745- if (rq->cmd_type == REQ_TYPE_FS ||746746- (rq->cmd_flags & REQ_DISCARD)) {747747- q->end_sector = rq_end_sector(rq);748748- q->boundary_rq = rq;749749- }750750- } else if (!(rq->cmd_flags & REQ_ELVPRIV) &&751751- where == ELEVATOR_INSERT_SORT)752752- where = ELEVATOR_INSERT_BACK;753753-754754- elv_insert(q, rq, where);755724}756725EXPORT_SYMBOL(__elv_add_request);757726