summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_subr.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2006-04-10 03:55:13 +0000
committermarcel <marcel@FreeBSD.org>2006-04-10 03:55:13 +0000
commitc168f9530e1b94a463b6747ea1f1bcb5b4ab8cbf (patch)
tree81cff68e80c2afb7c70386d60e4b5557ec440179 /sys/geom/geom_subr.c
parent271e02009f1ba97cb64faec0aef6565c45658e3e (diff)
downloadFreeBSD-src-c168f9530e1b94a463b6747ea1f1bcb5b4ab8cbf.zip
FreeBSD-src-c168f9530e1b94a463b6747ea1f1bcb5b4ab8cbf.tar.gz
Add g_wither_provider() to abstract the details of destroying a
particular provider. Use this function where g_orphan_provider() is being called so that the flags are updated correctly and g_orphan_provider() is called only when allowed.
Diffstat (limited to 'sys/geom/geom_subr.c')
-rw-r--r--sys/geom/geom_subr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index 8bedee9..623650a 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -318,6 +318,18 @@ g_wither_geom(struct g_geom *gp, int error)
}
/*
+ * Convenience function to destroy a particular provider.
+ */
+void
+g_wither_provider(struct g_provider *pp, int error)
+{
+
+ pp->flags |= G_PF_WITHER;
+ if (!(pp->flags & G_PF_ORPHAN))
+ g_orphan_provider(pp, error);
+}
+
+/*
* This function is called (repeatedly) until the has withered away.
*/
void
OpenPOWER on IntegriCloud