diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2008-10-14 03:51:06 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-10-17 02:46:57 -0400 |
commit | 80a4b58e36b63d7b0b592beb1bd6410aadeeb63c (patch) | |
tree | a37df7feb2db67254cc8927730828e87706b2205 /block/elevator.c | |
parent | ee2e992cc28553f6c4dd1ab5483c8733c393626b (diff) |
block: only call ->request_fn when the queue is not stopped
Callers should use either blk_run_queue/__blk_run_queue, or
blk_start_queueing() to invoke request handling instead of calling
->request_fn() directly as that does not take the queue stopped
flag into account.
Also add appropriate comments on the above functions to detail
their usage.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/elevator.c b/block/elevator.c index 9482ffa1aae6..59173a69ebdf 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -612,7 +612,7 @@ void elv_insert(struct request_queue *q, struct request *rq, int where) | |||
612 | * processing. | 612 | * processing. |
613 | */ | 613 | */ |
614 | blk_remove_plug(q); | 614 | blk_remove_plug(q); |
615 | q->request_fn(q); | 615 | blk_start_queueing(q); |
616 | break; | 616 | break; |
617 | 617 | ||
618 | case ELEVATOR_INSERT_SORT: | 618 | case ELEVATOR_INSERT_SORT: |
@@ -950,7 +950,7 @@ void elv_completed_request(struct request_queue *q, struct request *rq) | |||
950 | blk_ordered_cur_seq(q) == QUEUE_ORDSEQ_DRAIN && | 950 | blk_ordered_cur_seq(q) == QUEUE_ORDSEQ_DRAIN && |
951 | blk_ordered_req_seq(first_rq) > QUEUE_ORDSEQ_DRAIN) { | 951 | blk_ordered_req_seq(first_rq) > QUEUE_ORDSEQ_DRAIN) { |
952 | blk_ordered_complete_seq(q, QUEUE_ORDSEQ_DRAIN, 0); | 952 | blk_ordered_complete_seq(q, QUEUE_ORDSEQ_DRAIN, 0); |
953 | q->request_fn(q); | 953 | blk_start_queueing(q); |
954 | } | 954 | } |
955 | } | 955 | } |
956 | } | 956 | } |
@@ -1109,8 +1109,7 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e) | |||
1109 | elv_drain_elevator(q); | 1109 | elv_drain_elevator(q); |
1110 | 1110 | ||
1111 | while (q->rq.elvpriv) { | 1111 | while (q->rq.elvpriv) { |
1112 | blk_remove_plug(q); | 1112 | blk_start_queueing(q); |
1113 | q->request_fn(q); | ||
1114 | spin_unlock_irq(q->queue_lock); | 1113 | spin_unlock_irq(q->queue_lock); |
1115 | msleep(10); | 1114 | msleep(10); |
1116 | spin_lock_irq(q->queue_lock); | 1115 | spin_lock_irq(q->queue_lock); |