summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2011-07-06 16:05:55 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2011-07-06 16:05:55 +0000
commit99ae3b93adf7c9eed2180f6fe790056675ec0328 (patch)
treed3e8ed9ef055b05e9483ddc3207d5e315f8dfcb3 /sys/arch
parentcb74fa00bd5cc7c575b6f3f1dba0608b799374c2 (diff)
Ooops. Missed one 'readdoslabel() only' arch. Do the block <-> sector dance for
write label location here too.
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/mvmeppc/mvmeppc/disksubr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/mvmeppc/mvmeppc/disksubr.c b/sys/arch/mvmeppc/mvmeppc/disksubr.c
index 483d0d931d1..7a876187013 100644
--- a/sys/arch/mvmeppc/mvmeppc/disksubr.c
+++ b/sys/arch/mvmeppc/mvmeppc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.62 2011/04/16 03:21:15 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.63 2011/07/06 16:05:54 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -97,6 +97,7 @@ int
writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp)
{
int error = EIO, partoff = -1, cyl = 0;
+ int offset;
struct disklabel *dlp;
struct buf *bp = NULL;
@@ -108,7 +109,8 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp)
goto done;
/* Read it in, slap the new label in, and write it back out */
- bp->b_blkno = partoff + LABELSECTOR;
+ bp->b_blkno = DL_BLKTOSEC(lp, partoff+LABELSECTOR) * DL_BLKSPERSEC(lp);
+ offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
bp->b_bcount = lp->d_secsize;
CLR(bp->b_flags, B_READ | B_WRITE | B_DONE);
SET(bp->b_flags, B_BUSY | B_READ | B_RAW);
@@ -116,7 +118,7 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp)
if ((error = biowait(bp)) != 0)
goto done;
- dlp = (struct disklabel *)(bp->b_data + LABELOFFSET);
+ dlp = (struct disklabel *)(bp->b_data + offset);
*dlp = *lp;
CLR(bp->b_flags, B_READ | B_WRITE | B_DONE);
SET(bp->b_flags, B_BUSY | B_WRITE | B_RAW);