summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2004-02-02 19:49:41 +0000
committerphk <phk@FreeBSD.org>2004-02-02 19:49:41 +0000
commitf0fded48fd4d0ebb50a9c9c6a6b85dabbfa5d8b1 (patch)
tree6c695d918ceae1097c76c48efefb916099a331f5 /sys
parentb9b026e5be8e8bb0625809735d3a9b37dda0fcc3 (diff)
downloadFreeBSD-src-f0fded48fd4d0ebb50a9c9c6a6b85dabbfa5d8b1.zip
FreeBSD-src-f0fded48fd4d0ebb50a9c9c6a6b85dabbfa5d8b1.tar.gz
Allow a GEOM class to unload if it has no geoms or a method function to
get rid of them. Prodded by: pjd
Diffstat (limited to 'sys')
-rw-r--r--sys/geom/geom_subr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index 0d6d24c..a56c0af 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -126,7 +126,12 @@ g_unload_class(void *arg, int flag)
hh = arg;
mp = hh->mp;
g_trace(G_T_TOPOLOGY, "g_unload_class(%s)", mp->name);
- if (mp->destroy_geom == NULL) {
+
+ /*
+ * We allow unloading if we have no geoms, or a class
+ * method we can use to get rid of them.
+ */
+ if (!LIST_EMPTY(&mp->geom) && mp->destroy_geom == NULL) {
hh->error = EOPNOTSUPP;
return;
}
OpenPOWER on IntegriCloud