Lines Matching refs:queue
31 * rf_diskqueue.c -- higher-level disk queue code
39 * queue is locked, and no further I/Os are dispatched until the queue
47 * currently has the queue locked, so we make no such attempt. Since
107 * the disk queue switch defines all the functions used in the
108 * different queueing disciplines queue ID, init routine, enqueue
157 /* configures a single disk queue */
241 RF_ERRORMSG2("Unknown queue type \"%s\". Using %s\n", cfgPtr->diskQueueType, diskqueuesw[0].queueType);
282 * when any request arrives at a queue, we have two choices:
284 * queue it up
288 * normal req : queue empty => dispatch it & set priority
289 * queue not full & priority is ok => dispatch it
290 * else queue it
293 rf_DiskIOEnqueue(RF_DiskQueue_t *queue, RF_DiskQueueData_t *req, int pri)
304 RF_LOCK_QUEUE_MUTEX(queue, "DiskIOEnqueue");
305 if (RF_OK_TO_DISPATCH(queue, req)) {
306 Dprintf2("Dispatching pri %d regular op to c %d (ok to dispatch)\n", pri, queue->col);
307 rf_DispatchKernelIO(queue, req);
309 queue->queueLength++; /* increment count of number of requests waiting in this queue */
310 Dprintf2("Enqueueing pri %d regular op to c %d (not ok to dispatch)\n", pri, queue->col);
311 req->queue = (void *) queue;
312 (queue->qPtr->Enqueue) (queue->qHdr, req, pri);
314 RF_UNLOCK_QUEUE_MUTEX(queue, "DiskIOEnqueue");
320 rf_DiskIOComplete(RF_DiskQueue_t *queue, RF_DiskQueueData_t *req, int status)
324 RF_LOCK_QUEUE_MUTEX(queue, "DiskIOComplete");
325 queue->numOutstanding--;
326 RF_ASSERT(queue->numOutstanding >= 0);
329 /* no reason to continue once we've filled up the queue */
330 /* no reason to even start if the queue is locked */
332 while (!done && !RF_QUEUE_FULL(queue)) {
333 req = (queue->qPtr->Dequeue) (queue->qHdr);
335 Dprintf2("DiskIOComplete: extracting pri %d req from queue at c %d\n", req->priority, queue->col);
336 queue->queueLength--; /* decrement count of number of requests waiting in this queue */
337 RF_ASSERT(queue->queueLength >= 0);
338 if (RF_OK_TO_DISPATCH(queue, req)) {
339 Dprintf2("DiskIOComplete: dispatching pri %d regular req to c %d (ok to dispatch)\n", req->priority, queue->col);
340 rf_DispatchKernelIO(queue, req);
344 Dprintf2("DiskIOComplete: re-enqueueing pri %d regular req to c %d\n", req->priority, queue->col);
345 queue->queueLength++;
346 (queue->qPtr->Enqueue) (queue->qHdr, req, req->priority);
355 RF_UNLOCK_QUEUE_MUTEX(queue, "DiskIOComplete");
358 * to normal priority. This promotion is optional, meaning that a queue
360 * a queue, this routine does nothing and returns -1.
363 rf_DiskIOPromote(RF_DiskQueue_t *queue, RF_StripeNum_t parityStripeID,
368 if (!queue->qPtr->Promote)
370 RF_LOCK_QUEUE_MUTEX(queue, "DiskIOPromote");
371 retval = (queue->qPtr->Promote) (queue->qHdr, parityStripeID, which_ru);
372 RF_UNLOCK_QUEUE_MUTEX(queue, "DiskIOPromote");