summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-05-28 19:33:55 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-05-28 19:33:55 +0000
commit0a3d89d2094ec4d2673ff9d78b4ce069936fff6f (patch)
treed3bbe9432adf5888b4f86f85f8f9c4ab25062cd1
parentd9799c978dd0417a8b588efb03f47f0c35152c65 (diff)
Call readdisksector() instead of rolling our own. Drop <sys/systm.h>
include. Reduces the diffs to the amd64/i386 version of this code. ok drahn@
-rw-r--r--sys/arch/arm64/arm64/disksubr.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/sys/arch/arm64/arm64/disksubr.c b/sys/arch/arm64/arm64/disksubr.c
index 93d4e316e6b..e9d648e85ce 100644
--- a/sys/arch/arm64/arm64/disksubr.c
+++ b/sys/arch/arm64/arm64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.2 2017/02/28 10:49:37 natano Exp $ */
+/* $OpenBSD: disksubr.c,v 1.3 2018/05/28 19:33:54 kettenis Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -32,7 +32,6 @@
*/
#include <sys/param.h>
-#include <sys/systm.h>
#include <sys/buf.h>
#include <sys/disklabel.h>
#include <sys/disk.h>
@@ -110,15 +109,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;