summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_dump.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-05-21 20:33:49 +0000
committerphk <phk@FreeBSD.org>2002-05-21 20:33:49 +0000
commit476ca0197fe439db32412d254212efdcc10bd9cf (patch)
treefec49ff015cfe691229ddfbcf6205b4f482aec1e /sys/geom/geom_dump.c
parent4c8f46cf75901f6eeca741030d0075e8789c0566 (diff)
downloadFreeBSD-src-476ca0197fe439db32412d254212efdcc10bd9cf.zip
FreeBSD-src-476ca0197fe439db32412d254212efdcc10bd9cf.tar.gz
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.
Diffstat (limited to 'sys/geom/geom_dump.c')
-rw-r--r--sys/geom/geom_dump.c19
1 files changed, 19 insertions, 0 deletions
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, " <geom id=\"%p\">\n", gp);
sbuf_printf(sb, " <class ref=\"%p\"/>\n", gp->class);
sbuf_printf(sb, " <name>%s</name>\n", gp->name);
sbuf_printf(sb, " <rank>%d</rank>\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, " <magicspace>\n");
+ sbuf_printf(sb, " <name>%.8s</name>\n",
+ gsp->name);
+ sbuf_printf(sb, " <offset>%lld</offset>\n",
+ (long long)gsp->offset);
+ sbuf_printf(sb, " <length>%u</length>\n",
+ gsp->len);
+ sbuf_printf(sb, " <flags>%u</flags>\n",
+ gsp->flags);
+ sbuf_printf(sb, " </magicspace>\n");
+ }
+ }
if (gp->dumpconf) {
sbuf_printf(sb, " <config>\n");
gp->dumpconf(sb, "\t", gp, NULL, NULL);
OpenPOWER on IntegriCloud