elevator_dispatch_fn() is in charge of putting request on the dispatch
list. So it'll be called, if q->queue_head is empty to refill that. The
core is __elv_next_request(), which is called when a block driver wants
to queue more IO. The logic is essentially:
elv_next_request()
{
while (1) {
if (!list_empty(&q->queue_head))
return first rq of list
if (!elevator_dispatch_fn())
return NULL;
}
}
So if you queue_head is empty AND elevator_dispatch_fn returns 0, then
no request is given to the driver. IF elevator_dispatch_fn returns
non-zero, then it MUST have put request on the queue_head list.
--
Jens Axboe
-