FreeBSD/sys/geom/geom_subr.c
/*
 * This function is called (repeatedly) until we cant wash away more
 * withered bits at present.
 */
This function is called (repeatedly) until we cant wash away more
withered bits at present.
This function is called ( repeatedly ) until we cant wash away more withered bits at present .
void
g_wither_washer()
{
	struct g_class *mp;
	struct g_geom *gp, *gp2;
	struct g_provider *pp, *pp2;
	struct g_consumer *cp, *cp2;
	g_topology_assert();
	LIST_FOREACH(mp, &g_classes, class) {
		LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) {
			LIST_FOREACH_SAFE(pp, &gp->provider, provider, pp2) {
				if (!(pp->flags & G_PF_WITHER))
					continue;
				if (LIST_EMPTY(&pp->consumers))
					g_destroy_provider(pp);
			}
			if (!(gp->flags & G_GEOM_WITHER))
				continue;
			LIST_FOREACH_SAFE(pp, &gp->provider, provider, pp2) {
				if (LIST_EMPTY(&pp->consumers))
					g_destroy_provider(pp);
			}
			LIST_FOREACH_SAFE(cp, &gp->consumer, consumer, cp2) {
				if (cp->acr || cp->acw || cp->ace)
					continue;
				if (cp->provider != NULL)
					g_detach(cp);
				g_destroy_consumer(cp);
			}
			if (LIST_EMPTY(&gp->provider) &&
			    LIST_EMPTY(&gp->consumer))
				g_destroy_geom(gp);
		}
	}
}
void g_wither_washer ( ) { struct g_class * mp ; struct g_geom * gp , * gp2 ; struct g_provider * pp , * pp2 ; struct g_consumer * cp , * cp2 ; g_topology_assert ( ) ; LIST_FOREACH ( mp , & g_classes , class ) { LIST_FOREACH_SAFE ( gp , & mp -> geom , geom , gp2 ) { LIST_FOREACH_SAFE ( pp , & gp -> provider , provider , pp2 ) { if ( ! ( pp -> flags & G_PF_WITHER ) ) continue ; if ( LIST_EMPTY ( & pp -> consumers ) ) g_destroy_provider ( pp ) ; } if ( ! ( gp -> flags & G_GEOM_WITHER ) ) continue ; LIST_FOREACH_SAFE ( pp , & gp -> provider , provider , pp2 ) { if ( LIST_EMPTY ( & pp -> consumers ) ) g_destroy_provider ( pp ) ; } LIST_FOREACH_SAFE ( cp , & gp -> consumer , consumer , cp2 ) { if ( cp -> acr || cp -> acw || cp -> ace ) continue ; if ( cp -> provider != NULL ) g_detach ( cp ) ; g_destroy_consumer ( cp ) ; } if ( LIST_EMPTY ( & gp -> provider ) && LIST_EMPTY ( & gp -> consumer ) ) g_destroy_geom ( gp ) ; } } }
This function is called (repeatedly) until we cant wash away more
 withered bits at present.
This function is called ( repeatedly ) until we cant wash away more withered bits at present .