summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_dump.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-10-28 22:43:54 +0000
committerphk <phk@FreeBSD.org>2002-10-28 22:43:54 +0000
commit36b357552e8bf68a082895a618ce8fc14d7b21a8 (patch)
tree8613cc57c380af3393265fdf5313b0a510ee0433 /sys/geom/geom_dump.c
parentbddb286f465cd924b05f4d045c8154af4cd9238f (diff)
downloadFreeBSD-src-36b357552e8bf68a082895a618ce8fc14d7b21a8.zip
FreeBSD-src-36b357552e8bf68a082895a618ce8fc14d7b21a8.tar.gz
Add the remaning part of the new libdisk interaction.
WARNING: This is not a published interface, it is a stopgap measure for WARNING: libdisk so we can get 5.0-R out of the door. Sponsored by: DARPA & NAI Labs
Diffstat (limited to 'sys/geom/geom_dump.c')
-rw-r--r--sys/geom/geom_dump.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/sys/geom/geom_dump.c b/sys/geom/geom_dump.c
index 3827229..756e8ca 100644
--- a/sys/geom/geom_dump.c
+++ b/sys/geom/geom_dump.c
@@ -116,6 +116,50 @@ g_confdot(void *p)
wakeup(p);
}
+static void
+g_conftxt_geom(struct sbuf *sb, struct g_geom *gp, int level)
+{
+ struct g_provider *pp;
+ struct g_consumer *cp;
+
+ LIST_FOREACH(pp, &gp->provider, provider) {
+ sbuf_printf(sb, "%d %s %s %ju %u", level, gp->class->name,
+ pp->name, (uintmax_t)pp->mediasize, pp->sectorsize);
+ gp->dumpconf(sb, NULL, gp, NULL, pp);
+ sbuf_printf(sb, "\n");
+ LIST_FOREACH(cp, &pp->consumers, consumers)
+ g_conftxt_geom(sb, cp->geom, level + 1);
+ }
+}
+
+static void
+g_conftxt_class(struct sbuf *sb, struct g_class *mp)
+{
+ struct g_geom *gp;
+
+ LIST_FOREACH(gp, &mp->geom, geom)
+ g_conftxt_geom(sb, gp, 0);
+}
+
+void
+g_conftxt(void *p)
+{
+ struct g_class *mp;
+ struct sbuf *sb;
+
+ sb = p;
+ g_topology_assert();
+ LIST_FOREACH(mp, &g_classes, class)
+ if (!strcmp(mp->name, "DISK"))
+ break;
+ if (mp != NULL)
+ g_conftxt_class(sb, mp);
+ else
+ printf("no DISK\n");
+ sbuf_finish(sb);
+ wakeup(p);
+}
+
static void
g_conf_consumer(struct sbuf *sb, struct g_consumer *cp)
OpenPOWER on IntegriCloud