summaryrefslogtreecommitdiff
path: root/sys/arch/pmax
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-05-07 19:03:48 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-05-07 19:03:48 +0000
commitff633278b017921bc019f19a8262d60d9147a522 (patch)
tree380decf67c35bc4445a0923af1f560abe6f9b8d3 /sys/arch/pmax
parentc16d381f9fa78f4c3fd43daa8a33cddf6e422fed (diff)
Write disk label in canonical location, do not scan. With this change
you can now fix a label that is in the wrong place via: disklabel rz0 >! foo ; disklabel -R rz0 foo like disklabel says you can.
Diffstat (limited to 'sys/arch/pmax')
-rw-r--r--sys/arch/pmax/pmax/disksubr.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/sys/arch/pmax/pmax/disksubr.c b/sys/arch/pmax/pmax/disksubr.c
index afbeac9c5be..6a0c538d5d5 100644
--- a/sys/arch/pmax/pmax/disksubr.c
+++ b/sys/arch/pmax/pmax/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.11 1998/05/07 16:03:21 millert Exp $ */
+/* $OpenBSD: disksubr.c,v 1.12 1998/05/07 19:03:47 millert Exp $ */
/* $NetBSD: disksubr.c,v 1.14 1997/01/15 00:55:43 jonathan Exp $ */
/*
@@ -269,7 +269,6 @@ writedisklabel(dev, strat, lp, osdep)
struct cpu_disklabel *osdep;
{
struct buf *bp;
- struct disklabel *dlp;
int labelpart;
int error = 0;
@@ -287,28 +286,6 @@ writedisklabel(dev, strat, lp, osdep)
(*strat)(bp);
if ((error = biowait(bp)) != 0)
goto done;
- dlp = (struct disklabel *)bp->b_un.b_addr + LABELOFFSET;
- if (dlp->d_magic == DISKMAGIC && dlp->d_magic2 == DISKMAGIC &&
- dkcksum(dlp) == 0) {
- *dlp = *lp;
- bp->b_flags = B_WRITE;
- (*strat)(bp);
- error = biowait(bp);
- goto done;
- } else for (dlp = (struct disklabel *)bp->b_un.b_addr;
- dlp <= (struct disklabel *)
- (bp->b_un.b_addr + lp->d_secsize - sizeof(*dlp));
- dlp = (struct disklabel *)((char *)dlp + sizeof(long))) {
- if (dlp->d_magic == DISKMAGIC && dlp->d_magic2 == DISKMAGIC &&
- dkcksum(dlp) == 0) {
- *dlp = *lp;
- bp->b_flags = B_WRITE;
- (*strat)(bp);
- error = biowait(bp);
- goto done;
- }
- }
- /* Write it in the regular place. */
*(struct disklabel *)(bp->b_data + LABELOFFSET) = *lp;
bp->b_flags = B_BUSY | B_WRITE;
(*strat)(bp);