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().
···261 q->flush_rq.end_io = flush_end_io;262263 q->flush_pending_idx ^= 1;264- elv_insert(q, &q->flush_rq, ELEVATOR_INSERT_REQUEUE);265 return true;266}267···281 * blk_insert_flush - insert a new FLUSH/FUA request282 * @rq: request to insert283 *284- * To be called from elv_insert() for %ELEVATOR_INSERT_FLUSH insertions.285 * @rq is being submitted. Analyze what needs to be done and put it on the286 * right queue.287 *
···261 q->flush_rq.end_io = flush_end_io;262263 q->flush_pending_idx ^= 1;264+ __elv_add_request(q, &q->flush_rq, ELEVATOR_INSERT_REQUEUE);265 return true;266}267···281 * blk_insert_flush - insert a new FLUSH/FUA request282 * @rq: request to insert283 *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 the286 * right queue.287 *
+15-20
block/elevator.c
···610611 rq->cmd_flags &= ~REQ_STARTED;612613- elv_insert(q, rq, ELEVATOR_INSERT_REQUEUE);614}615616void elv_drain_elevator(struct request_queue *q)···655 queue_flag_clear(QUEUE_FLAG_ELVSWITCH, q);656}657658-void elv_insert(struct request_queue *q, struct request *rq, int where)659{660 trace_block_rq_insert(q, rq);661662 rq->q = q;0000000000000663664 switch (where) {665 case ELEVATOR_INSERT_REQUEUE:···734 __func__, where);735 BUG();736 }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}756EXPORT_SYMBOL(__elv_add_request);757
···610611 rq->cmd_flags &= ~REQ_STARTED;612613+ __elv_add_request(q, rq, ELEVATOR_INSERT_REQUEUE);614}615616void elv_drain_elevator(struct request_queue *q)···655 queue_flag_clear(QUEUE_FLAG_ELVSWITCH, q);656}657658+void __elv_add_request(struct request_queue *q, struct request *rq, int where)659{660 trace_block_rq_insert(q, rq);661662 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;676677 switch (where) {678 case ELEVATOR_INSERT_REQUEUE:···721 __func__, where);722 BUG();723 }000000000000000000724}725EXPORT_SYMBOL(__elv_add_request);726