The only user left for blk_insert_request() is sx8 and it can be trivially switched to use blk_execute_rq_nowait() - special requests aren't included in io stat and sx8 doesn't use block layer tagging. Switch sx8 and kill blk_insert_requeset(). This patch doesn't introduce any functional difference. Only compile tested.
Unified · Split
| @@ -1010,54 +1010,6 @@ static void add_acct_request(struct request_queue *q, struct request *rq, · 1009 unmodified lines | |||
| 1010 | __elv_add_request(q, rq, where); | 1010 | __elv_add_request(q, rq, where); |
| 1011 | } | 1011 | } |
| 1012 | 1012 | ||
| 1013 | /** | ||
| 1014 | * blk_insert_request - insert a special request into a request queue | ||
| 1015 | * @q: request queue where request should be inserted | ||
| 1016 | * @rq: request to be inserted | ||
| 1017 | * @at_head: insert request at head or tail of queue | ||
| 1018 | * @data: private data | ||
| 1019 | * | ||
| 1020 | * Description: | ||
| 1021 | * Many block devices need to execute commands asynchronously, so they don't | ||
| 1022 | * block the whole kernel from preemption during request execution. This is | ||
| 1023 | * accomplished normally by inserting aritficial requests tagged as | ||
| 1024 | * REQ_TYPE_SPECIAL in to the corresponding request queue, and letting them | ||
| 1025 | * be scheduled for actual execution by the request queue. | ||
| 1026 | * | ||
| 1027 | * We have the option of inserting the head or the tail of the queue. | ||
| 1028 | * Typically we use the tail for new ioctls and so forth. We use the head | ||
| 1029 | * of the queue for things like a QUEUE_FULL message from a device, or a | ||
| 1030 | * host that is unable to accept a particular command. | ||
| 1031 | */ | ||
| 1032 | void blk_insert_request(struct request_queue *q, struct request *rq, | ||
| 1033 | int at_head, void *data) | ||
| 1034 | { | ||
| 1035 | int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK; | ||
| 1036 | unsigned long flags; | ||
| 1037 | |||
| 1038 | /* | ||
| 1039 | * tell I/O scheduler that this isn't a regular read/write (ie it | ||
| 1040 | * must not attempt merges on this) and that it acts as a soft | ||
| 1041 | * barrier | ||
| 1042 | */ | ||
| 1043 | rq->cmd_type = REQ_TYPE_SPECIAL; | ||
| 1044 | |||
| 1045 | rq->special = data; | ||
| 1046 | |||
| 1047 | spin_lock_irqsave(q->queue_lock, flags); | ||
| 1048 | |||
| 1049 | /* | ||
| 1050 | * If command is tagged, release the tag | ||
| 1051 | */ | ||
| 1052 | if (blk_rq_tagged(rq)) | ||
| 1053 | blk_queue_end_tag(q, rq); | ||
| 1054 | |||
| 1055 | add_acct_request(q, rq, where); | ||
| 1056 | __blk_run_queue(q); | ||
| 1057 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
| 1058 | } | ||
| 1059 | EXPORT_SYMBOL(blk_insert_request); | ||
| 1060 | |||
| 1061 | static void part_round_stats_single(int cpu, struct hd_struct *part, | 1013 | static void part_round_stats_single(int cpu, struct hd_struct *part, |
| 1062 | unsigned long now) | 1014 | unsigned long now) |
| 1063 | { | 1015 | { |
| @@ -619,8 +619,10 @@ static int carm_array_info (struct carm_host *host, unsigned int array_idx) · 618 unmodified lines | |||
| 619 | host->state == HST_DEV_SCAN); | 619 | host->state == HST_DEV_SCAN); |
| 620 | spin_unlock_irq(&host->lock); | 620 | spin_unlock_irq(&host->lock); |
| 621 | 621 | ||
| 622 | DPRINTK("blk_insert_request, tag == %u\n", idx); | 622 | DPRINTK("blk_execute_rq_nowait, tag == %u\n", idx); |
| 623 | blk_insert_request(host->oob_q, crq->rq, 1, crq); | 623 | crq->rq->cmd_type = REQ_TYPE_SPECIAL; |
| 624 | crq->rq->special = crq; | ||
| 625 | blk_execute_rq_nowait(host->oob_q, NULL, crq->rq, true, NULL); | ||
| 624 | 626 | ||
| 625 | return 0; | 627 | return 0; |
| 626 | 628 | ||
| @@ -658,8 +660,10 @@ static int carm_send_special (struct carm_host *host, carm_sspc_t func) · 31 unmodified lines | |||
| 658 | BUG_ON(rc < 0); | 660 | BUG_ON(rc < 0); |
| 659 | crq->msg_bucket = (u32) rc; | 661 | crq->msg_bucket = (u32) rc; |
| 660 | 662 | ||
| 661 | DPRINTK("blk_insert_request, tag == %u\n", idx); | 663 | DPRINTK("blk_execute_rq_nowait, tag == %u\n", idx); |
| 662 | blk_insert_request(host->oob_q, crq->rq, 1, crq); | 664 | crq->rq->cmd_type = REQ_TYPE_SPECIAL; |
| 665 | crq->rq->special = crq; | ||
| 666 | blk_execute_rq_nowait(host->oob_q, NULL, crq->rq, true, NULL); | ||
| 663 | 667 | ||
| 664 | return 0; | 668 | return 0; |
| 665 | } | 669 | } |
| @@ -660,7 +660,6 @@ extern void __blk_put_request(struct request_queue *, struct request *); · 659 unmodified lines | |||
| 660 | extern struct request *blk_get_request(struct request_queue *, int, gfp_t); | 660 | extern struct request *blk_get_request(struct request_queue *, int, gfp_t); |
| 661 | extern struct request *blk_make_request(struct request_queue *, struct bio *, | 661 | extern struct request *blk_make_request(struct request_queue *, struct bio *, |
| 662 | gfp_t); | 662 | gfp_t); |
| 663 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); | ||
| 664 | extern void blk_requeue_request(struct request_queue *, struct request *); | 663 | extern void blk_requeue_request(struct request_queue *, struct request *); |
| 665 | extern void blk_add_request_payload(struct request *rq, struct page *page, | 664 | extern void blk_add_request_payload(struct request *rq, struct page *page, |
| 666 | unsigned int len); | 665 | unsigned int len); |