diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-09-27 20:20:24 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-09-27 20:20:24 +0000 |
commit | c1af4cb2dc617e67b67b7019b3441edaf5957de8 (patch) | |
tree | f2cd6d915eb1a8c98984719f6e4d927720c94732 /sys/arch/socppc | |
parent | f38491d18468a7cb9197274b3920aaf4d9a9886c (diff) |
Use readdisksector() instead of manual buf initialization. These are
identical to the amd64 change already committed.
ok deraadt@
Diffstat (limited to 'sys/arch/socppc')
-rw-r--r-- | sys/arch/socppc/socppc/disksubr.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/arch/socppc/socppc/disksubr.c b/sys/arch/socppc/socppc/disksubr.c index 76474cb5411..44e4ce954f5 100644 --- a/sys/arch/socppc/socppc/disksubr.c +++ b/sys/arch/socppc/socppc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.19 2013/10/19 09:32:15 krw Exp $ */ +/* $OpenBSD: disksubr.c,v 1.20 2015/09/27 20:20:23 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */ /* @@ -110,15 +110,11 @@ 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 = DL_BLKTOSEC(lp, partoff + DOS_LABELSECTOR) * - DL_BLKSPERSEC(lp); - offset = DL_BLKOFFSET(lp, partoff + DOS_LABELSECTOR); - 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) + error = readdisksector(bp, strat, lp, DL_BLKTOSEC(lp, partoff + + DOS_LABELSECTOR)); + if (error) goto done; + offset = DL_BLKOFFSET(lp, partoff + DOS_LABELSECTOR); dlp = (struct disklabel *)(bp->b_data + offset); *dlp = *lp; |