From 476ca0197fe439db32412d254212efdcc10bd9cf Mon Sep 17 00:00:00 2001 From: phk Date: Tue, 21 May 2002 20:33:49 +0000 Subject: Introduce the concept of "magic spaces", and implement them in most of the relevant classes. Some methods may implement various "magic spaces", this is reserved or magic areas on the disk, set a side for various and sundry purposes. A good example is the BSD disklabel and boot code on i386 which occupies a total of four magic spaces: boot1, the disklabel, the padding behind the disklabel and boot2. The reason we don't simply tell people to write the appropriate stuff on the underlying device is that (some of) the magic spaces might be real-time modifiable. It is for instance possible to change a disklabel while partitions are open, provided the open partitions do not get trampled in the process. Sponsored by: DARPA & NAI Labs. --- sys/geom/geom_dump.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'sys/geom/geom_dump.c') diff --git a/sys/geom/geom_dump.c b/sys/geom/geom_dump.c index 619e0ed..dcaee02 100644 --- a/sys/geom/geom_dump.c +++ b/sys/geom/geom_dump.c @@ -157,11 +157,30 @@ g_conf_geom(struct sbuf *sb, struct g_geom *gp, struct g_provider *pp, struct g_ { struct g_consumer *cp2; struct g_provider *pp2; + struct g_magicspace *gsp; + u_int u; sbuf_printf(sb, " \n", gp); sbuf_printf(sb, " \n", gp->class); sbuf_printf(sb, " %s\n", gp->name); sbuf_printf(sb, " %d\n", gp->rank); + if (gp->magicspaces) { + for (u = 0; u < gp->magicspaces->nmagic; u++) { + gsp = &gp->magicspaces->magicspace[u]; + if (gsp->len == 0 || gsp->name == NULL) + continue; + sbuf_printf(sb, " \n"); + sbuf_printf(sb, " %.8s\n", + gsp->name); + sbuf_printf(sb, " %lld\n", + (long long)gsp->offset); + sbuf_printf(sb, " %u\n", + gsp->len); + sbuf_printf(sb, " %u\n", + gsp->flags); + sbuf_printf(sb, " \n"); + } + } if (gp->dumpconf) { sbuf_printf(sb, " \n"); gp->dumpconf(sb, "\t", gp, NULL, NULL); -- cgit v1.1