summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_sunlabel.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-10-28 22:42:20 +0000
committerphk <phk@FreeBSD.org>2002-10-28 22:42:20 +0000
commitbddb286f465cd924b05f4d045c8154af4cd9238f (patch)
treeb7408682c3854d76bf52caaffe6396e64db6f9f8 /sys/geom/geom_sunlabel.c
parent2defbf45e4706d08dbe7d9ae663b4b10c07da443 (diff)
downloadFreeBSD-src-bddb286f465cd924b05f4d045c8154af4cd9238f.zip
FreeBSD-src-bddb286f465cd924b05f4d045c8154af4cd9238f.tar.gz
Add support for the new libdisk interaction.
Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'sys/geom/geom_sunlabel.c')
-rw-r--r--sys/geom/geom_sunlabel.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/geom/geom_sunlabel.c b/sys/geom/geom_sunlabel.c
index 5c9d6ad..715b423 100644
--- a/sys/geom/geom_sunlabel.c
+++ b/sys/geom/geom_sunlabel.c
@@ -59,7 +59,9 @@
#define SUNLABEL_CLASS_NAME "SUN"
struct g_sunlabel_softc {
- int foo;
+ int nheads;
+ int nsects;
+ int nalt;
};
static int
@@ -78,8 +80,16 @@ g_sunlabel_start(struct bio *bp)
static void
g_sunlabel_dumpconf(struct sbuf *sb, char *indent, struct g_geom *gp, struct g_consumer *cp __unused, struct g_provider *pp)
{
+ struct g_slicer *gsp;
+ struct g_sunlabel_softc *ms;
+ gsp = gp->softc;
+ ms = gsp->softc;
g_slice_dumpconf(sb, indent, gp, cp, pp);
+ if (indent == NULL) {
+ sbuf_printf(sb, " sc %u hd %u alt %u",
+ ms->nsects, ms->nheads, ms->nalt);
+ }
}
static struct g_geom *
@@ -151,8 +161,11 @@ g_sunlabel_taste(struct g_class *mp, struct g_provider *pp, int flags)
printf("v_head %d\n", g_dec_be2(buf + 436));
printf("v_sec %d\n", g_dec_be2(buf + 438));
}
+ ms->nalt = g_dec_be2(buf + 434);
+ ms->nheads = g_dec_be2(buf + 436);
+ ms->nsects = g_dec_be2(buf + 438);
- csize = g_dec_be2(buf + 436) * g_dec_be2(buf + 438);
+ csize = ms->nheads * ms->nsects;
for (i = 0; i < 8; i++) {
v = g_dec_be4(buf + 444 + i * 8);
OpenPOWER on IntegriCloud