diff options
author | phk <phk@FreeBSD.org> | 2004-03-11 08:16:23 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-03-11 08:16:23 +0000 |
commit | 8940a1c435c52cd4cbb1b37b746e9c6052a08fef (patch) | |
tree | df6f36c63650c8a6b652a97feb17a1bc793bb990 | |
parent | fc7667febaa59c3b8f249f27da954782dd241cb2 (diff) | |
download | FreeBSD-src-8940a1c435c52cd4cbb1b37b746e9c6052a08fef.zip FreeBSD-src-8940a1c435c52cd4cbb1b37b746e9c6052a08fef.tar.gz |
Be more insistent on destroying geoms at unload time. Still not perfect,
but it will do (better) for now.
KASSERT that to have providers a class must have an access method.
Tag the new_provider event with the geom as well.
-rw-r--r-- | sys/geom/geom_subr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c index 720a3d6..e669e8c 100644 --- a/sys/geom/geom_subr.c +++ b/sys/geom/geom_subr.c @@ -154,7 +154,10 @@ g_unload_class(void *arg, int flag) mp->config = NULL; error = 0; - LIST_FOREACH(gp, &mp->geom, geom) { + for (;;) { + gp = LIST_FIRST(&mp->geom); + if (gp == NULL) + break; error = mp->destroy_geom(NULL, mp, gp); if (error != 0) break; @@ -376,6 +379,9 @@ g_new_providerf(struct g_geom *gp, const char *fmt, ...) g_topology_assert(); G_VALID_GEOM(gp); + KASSERT(gp->access != NULL, + ("new provider on geom(%s) without ->access (class %s)", + gp->name, gp->class->name)); KASSERT(gp->start != NULL, ("new provider on geom(%s) without ->start (class %s)", gp->name, gp->class->name)); @@ -397,7 +403,7 @@ g_new_providerf(struct g_geom *gp, const char *fmt, ...) pp->stat = devstat_new_entry(pp, -1, 0, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); LIST_INSERT_HEAD(&gp->provider, pp, provider); - g_post_event(g_new_provider_event, pp, M_WAITOK, pp, NULL); + g_post_event(g_new_provider_event, pp, M_WAITOK, pp, gp, NULL); return (pp); } |