FreeBSD/sys/geom/sched/g_sched.c
/*
 * Complete the proxy destruction, linking the old provider to its
 * original geom, and destroying the proxy provider.  Also take care
 * of issuing the pending requests collected in me.gs_pending (if any).
 */
Complete the proxy destruction, linking the old provider to its
original geom, and destroying the proxy provider.  Also take care
of issuing the pending requests collected in me.gs_pending (if any).
Complete the proxy destruction linking the old provider to its original geom and destroying the proxy provider . Also take care of issuing the pending requests collected in me . gs_pending ( if any ) .
static int
g_destroy_proxy(struct g_geom *gp, struct g_provider *oldpp)
{
	struct g_consumer *cp;
	struct g_provider *newpp;
	do {
		cp = LIST_FIRST(&gp->consumer);
		if (cp == NULL)
			break;
		newpp = cp->provider;
		if (newpp == NULL)
			break;
		g_unproxy_provider(oldpp, newpp);
		cp->acr = newpp->acr = 0;
		cp->acw = newpp->acw = 0;
		cp->ace = newpp->ace = 0;
		g_detach(cp);
		g_sched_flush_pending(oldpp->geom->start);
		return (0);
	} while (0);
	printf("%s error destroying proxy %s\n", __FUNCTION__, gp->name);
	g_sched_flush_pending(g_sched_blackhole);
	return (EINVAL);
}
static int g_destroy_proxy ( struct g_geom * gp , struct g_provider * oldpp ) { struct g_consumer * cp ; struct g_provider * newpp ; do { cp = LIST_FIRST ( & gp -> consumer ) ; if ( cp == NULL ) break ; newpp = cp -> provider ; if ( newpp == NULL ) break ; g_unproxy_provider ( oldpp , newpp ) ; cp -> acr = newpp -> acr = 0 ; cp -> acw = newpp -> acw = 0 ; cp -> ace = newpp -> ace = 0 ; g_detach ( cp ) ; g_sched_flush_pending ( oldpp -> geom -> start ) ; return ( 0 ) ; } while ( 0 ) ; printf ( " \n " , __FUNCTION__ , gp -> name ) ; g_sched_flush_pending ( g_sched_blackhole ) ; return ( EINVAL ) ; }
Complete the proxy destruction, linking the old provider to its
 original geom, and destroying the proxy provider.
Complete the proxy destruction linking the old provider to its original geom and destroying the proxy provider .
/* Relink the provider to its original geom. */ /* Detach consumer from provider, and destroy provider. */ /* Send the pending bios through the right start function. */ /* We cannot send the pending bios anywhere... */