aboutsummaryrefslogtreecommitdiff
path: root/sys/geom/geom_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/geom/geom_subr.c')
-rw-r--r--sys/geom/geom_subr.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index ce2d876e44e8..d45dd2b6deb5 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -237,9 +237,7 @@ g_new_provider_event(void *arg, int flag)
struct g_class *mp;
struct g_provider *pp;
struct g_consumer *cp;
- struct g_geom *gp;
int i;
- u_long l1, l2;
g_topology_assert();
if (flag == EV_CANCEL)
@@ -256,12 +254,7 @@ g_new_provider_event(void *arg, int flag)
i = 0;
if (!i)
continue;
- l1 = M_GEOM[0].ks_memuse;
- gp = mp->taste(mp, pp, 0);
- l2 = M_GEOM[0].ks_memuse;
- if (l1 != l2)
- printf("%s %p %lu %lu -> %lu\n",
- mp->name, gp, l1, l2, l2 - l1);
+ mp->taste(mp, pp, 0);
g_topology_assert();
}
}
@@ -602,10 +595,20 @@ g_std_done(struct bio *bp)
void
g_std_spoiled(struct g_consumer *cp)
{
+ struct g_geom *gp;
+ struct g_provider *pp;
g_trace(G_T_TOPOLOGY, "g_std_spoiled(%p)", cp);
g_topology_assert();
- g_wither_geom(cp->geom, ENXIO);
+ g_detach(cp);
+ gp = cp->geom;
+ LIST_FOREACH(pp, &gp->provider, provider)
+ g_orphan_provider(pp, ENXIO);
+ g_destroy_consumer(cp);
+ if (LIST_EMPTY(&gp->provider) && LIST_EMPTY(&gp->consumer))
+ g_destroy_geom(gp);
+ else
+ gp->flags |= G_GEOM_WITHER;
}
/*