summaryrefslogtreecommitdiff
path: root/sys/arch/hppa
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-06-09 04:08:40 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-06-09 04:08:40 +0000
commit8db24ffd6547f4051a73e32d3237e9c38c40cac3 (patch)
tree51e11377a986486a428ac1c25c02fcfaefa5099f /sys/arch/hppa
parent286d80d720e22c23855a4337f119fcb87ef9f023 (diff)
by hand i carefully found that all the differences in setdisklabel()
implimentations were simply either missing code, or spacing and such. setdisklabel() can become MI now.
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r--sys/arch/hppa/hppa/disksubr.c62
1 files changed, 1 insertions, 61 deletions
diff --git a/sys/arch/hppa/hppa/disksubr.c b/sys/arch/hppa/hppa/disksubr.c
index f4263f33cfa..3073277ff42 100644
--- a/sys/arch/hppa/hppa/disksubr.c
+++ b/sys/arch/hppa/hppa/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.59 2007/06/09 02:03:47 deraadt Exp $ */
+/* $OpenBSD: disksubr.c,v 1.60 2007/06/09 04:08:39 deraadt Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -542,66 +542,6 @@ readliflabel(struct buf *bp, void (*strat)(struct buf *),
LABELOFFSET, lp, spoofonly);
}
-/*
- * Check new disk label for sensibility
- * before setting it.
- */
-int
-setdisklabel(struct disklabel *olp, struct disklabel *nlp,
- u_int openmask, struct cpu_disklabel *osdep)
-{
- int i;
- struct partition *opp, *npp;
-
- /* sanity clause */
- if (nlp->d_secpercyl == 0 || nlp->d_secsize == 0 ||
- (nlp->d_secsize % DEV_BSIZE) != 0)
- return (EINVAL);
-
- /*
- * XXX Nice thought, but it doesn't work, if the intention was to
- * force a reread at the next *readdisklabel call. That does not
- * happen. There's still some use for it though as you can pseudo-
- * partition the disk.
- *
- * Special case to allow disklabel to be invalidated.
- */
- if (nlp->d_magic == 0xffffffff) {
- *olp = *nlp;
- return (0);
- }
-
- if (nlp->d_magic != DISKMAGIC || nlp->d_magic2 != DISKMAGIC ||
- dkcksum(nlp) != 0)
- return (EINVAL);
-
- /* XXX missing check if other dos partitions will be overwritten */
-
- while (openmask != 0) {
- i = ffs(openmask) - 1;
- openmask &= ~(1 << i);
- if (nlp->d_npartitions <= i)
- return (EBUSY);
- opp = &olp->d_partitions[i];
- npp = &nlp->d_partitions[i];
- if (DL_GETPOFFSET(npp) != DL_GETPOFFSET(opp) ||
- DL_GETPSIZE(npp) < DL_GETPSIZE(opp))
- return (EBUSY);
- /*
- * Copy internally-set partition information
- * if new label doesn't include it. XXX
- */
- if (npp->p_fstype == FS_UNUSED && opp->p_fstype != FS_UNUSED) {
- npp->p_fstype = opp->p_fstype;
- npp->p_fragblock = opp->p_fragblock;
- npp->p_cpg = opp->p_cpg;
- }
- }
- nlp->d_checksum = 0;
- nlp->d_checksum = dkcksum(nlp);
- *olp = *nlp;
- return (0);
-}
/*