FreeBSD/sys/dev/xen/blkfront/blkfront.c
/*
 * Dequeue buffers and place them in the shared communication ring.
 * Return when no more requests can be accepted or all buffers have 
 * been queued.
 *
 * Signal XEN once the ring has been filled out.
 */
Dequeue buffers and place them in the shared communication ring.
Return when no more requests can be accepted or all buffers have
been queued.

Signal XEN once the ring has been filled out.
Dequeue buffers and place them in the shared communication ring . Return when no more requests can be accepted or all buffers have been queued . Signal XEN once the ring has been filled out .
static void
xbd_startio(struct xbd_softc *sc)
{
	struct xbd_command *cm;
	int error, queued = 0;
	mtx_assert(&sc->xbd_io_lock, MA_OWNED);
	if (sc->xbd_state != XBD_STATE_CONNECTED)
		return;
	while (!RING_FULL(&sc->xbd_ring)) {
		if (sc->xbd_qfrozen_cnt != 0)
			break;
		cm = xbd_dequeue_cm(sc, XBD_Q_READY);
		if (cm == NULL)
		    cm = xbd_bio_command(sc);
		if (cm == NULL)
			break;
		if ((cm->cm_flags & XBDCF_Q_FREEZE) != 0) {
			xbd_cm_freeze(sc, cm, XBDCF_Q_FREEZE);
		}
		if ((error = xbd_queue_request(sc, cm)) != 0) {
			printf("xbd_queue_request returned %d\n", error);
			break;
		}
		queued++;
	}
	if (queued != 0) 
		xbd_flush_requests(sc);
}
static void xbd_startio ( struct xbd_softc * sc ) { struct xbd_command * cm ; int error , queued = 0 ; mtx_assert ( & sc -> xbd_io_lock , MA_OWNED ) ; if ( sc -> xbd_state != XBD_STATE_CONNECTED ) return ; while ( ! RING_FULL ( & sc -> xbd_ring ) ) { if ( sc -> xbd_qfrozen_cnt != 0 ) break ; cm = xbd_dequeue_cm ( sc , XBD_Q_READY ) ; if ( cm == NULL ) cm = xbd_bio_command ( sc ) ; if ( cm == NULL ) break ; if ( ( cm -> cm_flags & XBDCF_Q_FREEZE ) != 0 ) { xbd_cm_freeze ( sc , cm , XBDCF_Q_FREEZE ) ; } if ( ( error = xbd_queue_request ( sc , cm ) ) != 0 ) { printf ( " \n " , error ) ; break ; } queued ++ ; } if ( queued != 0 ) xbd_flush_requests ( sc ) ; }
Dequeue buffers and place them in the shared communication ring.
Dequeue buffers and place them in the shared communication ring .
/*
			 * Single step command.  Future work is
			 * held off until this command completes.
			 */