summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/geom/geom.h3
-rw-r--r--sys/geom/geom_dev.c14
2 files changed, 17 insertions, 0 deletions
diff --git a/sys/geom/geom.h b/sys/geom/geom.h
index d12b901..14a5e6f 100644
--- a/sys/geom/geom.h
+++ b/sys/geom/geom.h
@@ -192,6 +192,9 @@ struct geomidorname {
} u;
};
+/* geom_dev.c */
+int g_dev_print(void);
+
/* geom_dump.c */
void g_hexdump(void *ptr, int length);
void g_trace(int level, char *, ...);
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index b23ef95..bbf0090 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -87,6 +87,20 @@ static struct g_class g_dev_class = {
G_CLASS_INITIALIZER
};
+int
+g_dev_print(void)
+{
+ struct g_geom *gp;
+
+ if (LIST_EMPTY(&g_dev_class.geom))
+ return (0);
+ printf("List of GEOM disk devices:\n ");
+ LIST_FOREACH(gp, &g_dev_class.geom, geom)
+ printf(" %s", gp->name);
+ printf("\n");
+ return (1);
+}
+
static void
g_dev_clone(void *arg __unused, char *name, int namelen __unused, dev_t *dev)
{
OpenPOWER on IntegriCloud