diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2010-04-23 15:25:22 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2010-04-23 15:25:22 +0000 |
commit | 38fc778c9782dbaa70fa6da92cfd8daaaa43d6fe (patch) | |
tree | ae3cdf39a2c58715ddd572c6ba0e0e6d72ea4ce2 /sys/arch/sparc64 | |
parent | ed069888a3c009f9af5ecffb1dd73b037a5b95c2 (diff) |
Recycle unused disklabel fields in order to create a disklabel unique
identifier, allowing the disk to be identified without relying on the
device name.
ok deraadt@ krw@ beck@ marco@ todd@
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/dev/fd.c | 4 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/disksubr.c | 12 | ||||
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/ofdev.c | 5 |
3 files changed, 7 insertions, 14 deletions
diff --git a/sys/arch/sparc64/dev/fd.c b/sys/arch/sparc64/dev/fd.c index ee7cbddd59b..0778e8f36d9 100644 --- a/sys/arch/sparc64/dev/fd.c +++ b/sys/arch/sparc64/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.29 2009/09/12 01:23:30 krw Exp $ */ +/* $OpenBSD: fd.c,v 1.30 2010/04/23 15:25:21 jsing Exp $ */ /* $NetBSD: fd.c,v 1.112 2003/08/07 16:29:35 agc Exp $ */ /*- @@ -2021,11 +2021,9 @@ fdgetdisklabel(dev_t dev, struct fd_softc *fd, struct disklabel *lp, lp->d_ncylinders = fd->sc_type->tracks; lp->d_ntracks = fd->sc_type->heads; /* Go figure... */ DL_SETDSIZE(lp, (daddr64_t)lp->d_secpercyl * lp->d_ncylinders); - lp->d_rpm = 300; /* XXX like it matters... */ strncpy(lp->d_typename, "floppy disk", sizeof(lp->d_typename)); strncpy(lp->d_packname, "fictitious", sizeof(lp->d_packname)); - lp->d_interleave = 1; lp->d_version = 1; lp->d_magic = DISKMAGIC; diff --git a/sys/arch/sparc64/sparc64/disksubr.c b/sys/arch/sparc64/sparc64/disksubr.c index 58d977d54e0..1df531ea2a3 100644 --- a/sys/arch/sparc64/sparc64/disksubr.c +++ b/sys/arch/sparc64/sparc64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.58 2010/02/26 23:11:57 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.59 2010/04/23 15:25:21 jsing Exp $ */ /* $NetBSD: disksubr.c,v 1.13 2000/12/17 22:39:18 pk Exp $ */ /* @@ -260,10 +260,9 @@ disklabel_sun_to_bsd(struct sun_disklabel *sl, struct disklabel *lp) DL_SETDSIZE(lp, (daddr64_t)secpercyl * sl->sl_ncylinders); lp->d_version = 1; - lp->d_sparespercyl = sl->sl_sparespercyl; + lp->d_label_uid = sl->sl_label_uid; + lp->d_acylinders = sl->sl_acylinders; - lp->d_rpm = sl->sl_rpm; - lp->d_interleave = sl->sl_interleave; lp->d_npartitions = MAXPARTITIONS; /* These are as defined in <ufs/ffs/fs.h> */ @@ -401,15 +400,14 @@ disklabel_bsd_to_sun(struct disklabel *lp, struct sun_disklabel *sl) /* Format conversion. */ bzero(sl, sizeof(*sl)); memcpy(sl->sl_text, lp->d_packname, sizeof(lp->d_packname)); - sl->sl_rpm = lp->d_rpm; sl->sl_pcylinders = lp->d_ncylinders + lp->d_acylinders; /* XXX */ - sl->sl_sparespercyl = lp->d_sparespercyl; - sl->sl_interleave = lp->d_interleave; sl->sl_ncylinders = lp->d_ncylinders; sl->sl_acylinders = lp->d_acylinders; sl->sl_ntracks = lp->d_ntracks; sl->sl_nsectors = lp->d_nsectors; + sl->sl_label_uid = lp->d_label_uid; + secpercyl = sl->sl_nsectors * sl->sl_ntracks; for (i = 0; i < 8; i++) { spp = &sl->sl_part[i]; diff --git a/sys/arch/sparc64/stand/ofwboot/ofdev.c b/sys/arch/sparc64/stand/ofwboot/ofdev.c index 325051b0400..745264bebbf 100644 --- a/sys/arch/sparc64/stand/ofwboot/ofdev.c +++ b/sys/arch/sparc64/stand/ofwboot/ofdev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofdev.c,v 1.12 2009/11/04 12:03:57 jsing Exp $ */ +/* $OpenBSD: ofdev.c,v 1.13 2010/04/23 15:25:21 jsing Exp $ */ /* $NetBSD: ofdev.c,v 1.1 2000/08/20 14:58:41 mrg Exp $ */ /* @@ -258,10 +258,7 @@ disklabel_sun_to_bsd(char *cp, struct disklabel *lp) lp->d_secpercyl = secpercyl; lp->d_secperunit = secpercyl * sl->sl_ncylinders; - lp->d_sparespercyl = sl->sl_sparespercyl; lp->d_acylinders = sl->sl_acylinders; - lp->d_rpm = sl->sl_rpm; - lp->d_interleave = sl->sl_interleave; lp->d_npartitions = MAXPARTITIONS; /* These are as defined in <ufs/ffs/fs.h> */ |