Changeset View
Changeset View
Standalone View
Standalone View
head/sys/geom/geom_subr.c
Show First 20 Lines • Show All 625 Lines • ▼ Show 20 Lines | g_resize_provider_event(void *arg, int flag) | ||||
G_VALID_PROVIDER(pp); | G_VALID_PROVIDER(pp); | ||||
KASSERT(!(pp->flags & G_PF_WITHER), | KASSERT(!(pp->flags & G_PF_WITHER), | ||||
("g_resize_provider_event but withered")); | ("g_resize_provider_event but withered")); | ||||
g_trace(G_T_TOPOLOGY, "g_resize_provider_event(%p)", pp); | g_trace(G_T_TOPOLOGY, "g_resize_provider_event(%p)", pp); | ||||
LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { | LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { | ||||
gp = cp->geom; | gp = cp->geom; | ||||
if (gp->resize == NULL && size < pp->mediasize) { | if (gp->resize == NULL && size < pp->mediasize) { | ||||
/* | |||||
* XXX: g_dev_orphan method does deferred destroying | |||||
* and it is possible, that other event could already | |||||
* call the orphan method. Check consumer's flags to | |||||
* do not schedule it twice. | |||||
*/ | |||||
if (cp->flags & G_CF_ORPHAN) | |||||
continue; | |||||
cp->flags |= G_CF_ORPHAN; | cp->flags |= G_CF_ORPHAN; | ||||
cp->geom->orphan(cp); | cp->geom->orphan(cp); | ||||
} | } | ||||
} | } | ||||
pp->mediasize = size; | pp->mediasize = size; | ||||
LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { | LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { | ||||
▲ Show 20 Lines • Show All 920 Lines • Show Last 20 Lines |