diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-09-28 21:52:29 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-09-28 21:52:29 +0000 |
commit | 19d7760d05b4ac89efc6806e3499cf215685d56d (patch) | |
tree | 08e94cb1f9499f300662e4baa62d63fd1d7f3c2c /sys/arch/hppa | |
parent | 81fb44468ff2309e6099251d8d26d030a859340a (diff) |
More mechanical switching to readdisksector(), although this is a
slightly different pattern. hppa/macppc compile and boot so
hppa64/aviion surely do too!
ok deraadt@
Diffstat (limited to 'sys/arch/hppa')
-rw-r--r-- | sys/arch/hppa/hppa/disksubr.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/arch/hppa/hppa/disksubr.c b/sys/arch/hppa/hppa/disksubr.c index 8d71713f352..31eef20939a 100644 --- a/sys/arch/hppa/hppa/disksubr.c +++ b/sys/arch/hppa/hppa/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.86 2015/09/28 01:17:57 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.87 2015/09/28 21:52:28 krw Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -242,22 +242,19 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; + /* Read it in, slap the new label in, and write it back out */ if (readliflabel(bp, strat, lp, &partoff, 1) == 0) { - bp->b_blkno = partoff + LABELSECTOR; + error = readdisksector(bp, strat, lp, DL_BLKTOSEC(lp, + partoff + LABELSECTOR)); offset = LABELOFFSET; } else if (readdoslabel(bp, strat, lp, &partoff, 1) == 0) { - bp->b_blkno = DL_BLKTOSEC(lp, partoff + DOS_LABELSECTOR) * - DL_BLKSPERSEC(lp); + error = readdisksector(bp, strat, lp, DL_BLKTOSEC(lp, + partoff + DOS_LABELSECTOR)); offset = DL_BLKOFFSET(lp, partoff + DOS_LABELSECTOR); } else goto done; - /* Read it in, slap the new label in, and write it back out */ - 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); - (*strat)(bp); - if ((error = biowait(bp)) != 0) + if (error) goto done; dlp = (struct disklabel *)(bp->b_data + offset); |