summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2015-09-27 20:20:24 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2015-09-27 20:20:24 +0000
commitc1af4cb2dc617e67b67b7019b3441edaf5957de8 (patch)
treef2cd6d915eb1a8c98984719f6e4d927720c94732 /sys/arch/loongson
parentf38491d18468a7cb9197274b3920aaf4d9a9886c (diff)
Use readdisksector() instead of manual buf initialization. These are
identical to the amd64 change already committed. ok deraadt@
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r--sys/arch/loongson/loongson/disksubr.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/arch/loongson/loongson/disksubr.c b/sys/arch/loongson/loongson/disksubr.c
index 7a02006ac31..89574f48946 100644
--- a/sys/arch/loongson/loongson/disksubr.c
+++ b/sys/arch/loongson/loongson/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.8 2013/10/19 09:32:14 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.9 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;