summaryrefslogtreecommitdiffstats
path: root/block/elevator.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-10-14 09:51:06 +0200
committerJens Axboe <jens.axboe@oracle.com>2008-10-17 08:46:57 +0200
commit80a4b58e36b63d7b0b592beb1bd6410aadeeb63c (patch)
treea37df7feb2db67254cc8927730828e87706b2205 /block/elevator.c
parentee2e992cc28553f6c4dd1ab5483c8733c393626b (diff)
downloadop-kernel-dev-80a4b58e36b63d7b0b592beb1bd6410aadeeb63c.zip
op-kernel-dev-80a4b58e36b63d7b0b592beb1bd6410aadeeb63c.tar.gz
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.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/block/elevator.c b/block/elevator.c
index 9482ffa..59173a6 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)
* processing.
*/
blk_remove_plug(q);
- q->request_fn(q);
+ blk_start_queueing(q);
break;
case ELEVATOR_INSERT_SORT:
@@ -950,7 +950,7 @@ void elv_completed_request(struct request_queue *q, struct request *rq)
blk_ordered_cur_seq(q) == QUEUE_ORDSEQ_DRAIN &&
blk_ordered_req_seq(first_rq) > QUEUE_ORDSEQ_DRAIN) {
blk_ordered_complete_seq(q, QUEUE_ORDSEQ_DRAIN, 0);
- q->request_fn(q);
+ blk_start_queueing(q);
}
}
}
@@ -1109,8 +1109,7 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e)
elv_drain_elevator(q);
while (q->rq.elvpriv) {
- blk_remove_plug(q);
- q->request_fn(q);
+ blk_start_queueing(q);
spin_unlock_irq(q->queue_lock);
msleep(10);
spin_lock_irq(q->queue_lock);
OpenPOWER on IntegriCloud