summaryrefslogtreecommitdiffstats
path: root/sys/sys/disklabel.h
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-04-04 20:34:48 +0000
committerphk <phk@FreeBSD.org>2002-04-04 20:34:48 +0000
commit38f498fe43ea5f40a284797ebdbe58e525227a99 (patch)
tree1410c4b3970b96cc00456831f60161ca3e02a9c4 /sys/sys/disklabel.h
parent0f8b0dba50c96a459b254917e1b88c44d518cdea (diff)
downloadFreeBSD-src-38f498fe43ea5f40a284797ebdbe58e525227a99.zip
FreeBSD-src-38f498fe43ea5f40a284797ebdbe58e525227a99.tar.gz
Delete the bogus d_boot[01] fields from struct disklabel.
This shrinks the size 4 bytes on alpha, down to the same 276 bytes as all other platforms. Construct a hack to make old ioctls work on new kernels. Once world is recompiled only the new and correct sysctls will be used. This hack will become annoying around 1st of may to make people rebuild their worlds and it will be gone before 5.0.
Diffstat (limited to 'sys/sys/disklabel.h')
-rw-r--r--sys/sys/disklabel.h37
1 files changed, 19 insertions, 18 deletions
diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h
index d709eed..6a52669 100644
--- a/sys/sys/disklabel.h
+++ b/sys/sys/disklabel.h
@@ -98,24 +98,7 @@ struct disklabel {
u_int16_t d_subtype; /* controller/d_type specific */
char d_typename[16]; /* type name, e.g. "eagle" */
- /*
- * d_packname contains the pack identifier and is returned when
- * the disklabel is read off the disk or in-core copy.
- * d_boot0 and d_boot1 are the (optional) names of the
- * primary (block 0) and secondary (block 1-15) bootstraps
- * as found in /boot. These are returned when using
- * getdiskbyname(3) to retrieve the values from /etc/disktab.
- */
- union {
- char un_d_packname[16]; /* pack identifier */
- struct {
- char *un_d_boot0; /* primary bootstrap name */
- char *un_d_boot1; /* secondary bootstrap name */
- } un_b;
- } d_un;
-#define d_packname d_un.un_d_packname
-#define d_boot0 d_un.un_b.un_d_boot0
-#define d_boot1 d_un.un_b.un_d_boot1
+ char d_packname[16]; /* pack identifier */
/* disk geometry: */
u_int32_t d_secsize; /* # of bytes per sector */
@@ -184,6 +167,10 @@ struct disklabel {
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
+#ifdef CTASSERT
+CTASSERT(sizeof(struct disklabel) == 276);
+#endif
+
static __inline u_int16_t dkcksum(struct disklabel *lp);
static __inline u_int16_t
dkcksum(lp)
@@ -374,6 +361,20 @@ CTASSERT(sizeof (struct dos_partition) == 16);
#define DIOCGFWCYLINDERS _IOR('d', 132, u_int) /* Get firmware cyl'scount */
#define DIOCGKERNELDUMP _IOW('d', 133, u_int) /* Set/Clear kernel dumps */
+#ifdef __alpha__
+struct disklabel_alphahack {
+ struct disklabel dl;
+ char pad[4];
+};
+#define DIOCGDINFO_ALPHAHACK _IOR('d', 101, struct disklabel_alphahack)/* get */
+#define DIOCSDINFO_ALPHAHACK _IOW('d', 102, struct disklabel_alphahack)/* set */
+#define DIOCWDINFO_ALPHAHACK _IOW('d', 103, struct disklabel_alphahack)/* set, update disk */
+#define DIOCGDVIRGIN_ALPHAHACK _IOR('d', 105, struct disklabel_alphahack)/* get virgin label */
+#ifdef CTASSERT
+CTASSERT(sizeof(struct disklabel_alphahack) == 280);
+#endif
+#endif
+
#ifdef _KERNEL
/*
OpenPOWER on IntegriCloud