FreeBSD/sys/geom/sched/g_sched.c
/*
 * The main dispatch loop, called either here after the start
 * routine, or by scheduling algorithms when they receive a timeout
 * or a 'done' notification.  Does not share code with the forced
 * dispatch path, since the gs_done() callback can call us.
 */
The main dispatch loop, called either here after the start
routine, or by scheduling algorithms when they receive a timeout
or a 'done' notification.  Does not share code with the forced
dispatch path, since the gs_done() callback can call us.
The main dispatch loop called either here after the start routine or by scheduling algorithms when they receive a timeout or a ' done ' notification . Does not share code with the forced dispatch path since the gs_done () callback can call us .
void
g_sched_dispatch(struct g_geom *gp)
{
	struct g_sched_softc *sc = gp->softc;
	struct g_gsched *gsp = sc->sc_gsched;
	struct bio *bp;
	KASSERT(mtx_owned(&sc->sc_mtx), ("sc_mtx not owned during dispatch"));
	if ((sc->sc_flags & G_SCHED_FLUSHING))
		return;
	while ((bp = gsp->gs_next(sc->sc_data, 0)) != NULL)
		g_io_request(bp, LIST_FIRST(&gp->consumer));
}
void g_sched_dispatch ( struct g_geom * gp ) { struct g_sched_softc * sc = gp -> softc ; struct g_gsched * gsp = sc -> sc_gsched ; struct bio * bp ; KASSERT ( mtx_owned ( & sc -> sc_mtx ) , ( " " ) ) ; if ( ( sc -> sc_flags & G_SCHED_FLUSHING ) ) return ; while ( ( bp = gsp -> gs_next ( sc -> sc_data , 0 ) ) != NULL ) g_io_request ( bp , LIST_FIRST ( & gp -> consumer ) ) ; }
The main dispatch loop, called either here after the start
 routine, or by scheduling algorithms when they receive a timeout
 or a 'done' notification.
The main dispatch loop called either here after the start routine or by scheduling algorithms when they receive a timeout or a ' done ' notification .