FreeBSD/sys/geom/sched/g_sched.c
/*
 * Wait for the completion of any outstanding request.  To ensure
 * that this does not take forever the caller has to make sure that
 * no new request enter the scehduler before calling us.
 *
 * Must be called with the gp mutex held and topology locked.
 */
Wait for the completion of any outstanding request.  To ensure
that this does not take forever the caller has to make sure that
no new request enter the scehduler before calling us.

Must be called with the gp mutex held and topology locked.
Wait for the completion of any outstanding request . To ensure that this does not take forever the caller has to make sure that no new request enter the scehduler before calling us . Must be called with the gp mutex held and topology locked .
static int
g_sched_wait_pending(struct g_geom *gp)
{
	struct g_sched_softc *sc = gp->softc;
	int endticks = ticks + hz;
	g_topology_assert();
	while (sc->sc_pending && endticks - ticks >= 0)
		msleep(gp, &sc->sc_mtx, 0, "sched_wait_pending", hz / 4);
	return (sc->sc_pending ? ETIMEDOUT : 0);
}
static int g_sched_wait_pending ( struct g_geom * gp ) { struct g_sched_softc * sc = gp -> softc ; int endticks = ticks + hz ; g_topology_assert ( ) ; while ( sc -> sc_pending && endticks - ticks >= 0 ) msleep ( gp , & sc -> sc_mtx , 0 , " " , hz / 4 ) ; return ( sc -> sc_pending ? ETIMEDOUT : 0 ) ; }
Wait for the completion of any outstanding request.
Wait for the completion of any outstanding request .