__elv_add_request

来源:互联网 发布:java分布式开发是什么 编辑:程序博客网 时间:2024/06/11 21:12
1. add_acct_request(blk_insert_cloned_request, blk_queue_bio)
2. blk_flush_plug_list
3. blk_execute_rq_nowait
4. elv_requeue_request
5. elv_add_request
6. ide_pm_execute_rq
void __elv_add_request(struct request_queue *q, struct request *rq, int where)
{trace_block_rq_insert(q, rq);blk_pm_add_request(q, rq);rq->q = q;
if (rq->cmd_flags & REQ_SOFTBARRIER) {/* barriers are scheduling boundary, update end_sector */if (rq->cmd_type == REQ_TYPE_FS) {q->end_sector = rq_end_sector(rq);q->boundary_rq = rq;}} else if (!(rq->cmd_flags & REQ_ELVPRIV) &&    (where == ELEVATOR_INSERT_SORT ||     where == ELEVATOR_INSERT_SORT_MERGE))where = ELEVATOR_INSERT_BACK;switch (where) {case ELEVATOR_INSERT_REQUEUE:case ELEVATOR_INSERT_FRONT:rq->cmd_flags |= REQ_SOFTBARRIER;list_add(&rq->queuelist, &q->queue_head);break;case ELEVATOR_INSERT_BACK:rq->cmd_flags |= REQ_SOFTBARRIER;elv_drain_elevator(q);list_add_tail(&rq->queuelist, &q->queue_head);__blk_run_queue(q);break;case ELEVATOR_INSERT_SORT_MERGE:if (elv_attempt_insert_merge(q, rq))break;case ELEVATOR_INSERT_SORT:BUG_ON(rq->cmd_type != REQ_TYPE_FS);rq->cmd_flags |= REQ_SORTED;q->nr_sorted++;if (rq_mergeable(rq)) {elv_rqhash_add(q, rq);if (!q->last_merge)q->last_merge = rq;}q->elevator->type->ops.elevator_add_req_fn(q, rq);break;case ELEVATOR_INSERT_FLUSH:rq->cmd_flags |= REQ_SOFTBARRIER;blk_insert_flush(rq);break;default:printk(KERN_ERR "%s: bad insertion point %d\n",       __func__, where);BUG();}}
0 0
原创粉丝点击