diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc/sparc/disksubr.c | 12 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/disksubr.c | 12 |
2 files changed, 6 insertions, 18 deletions
diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c index 0b83451fbb3..f894173f7e6 100644 --- a/sys/arch/sparc/sparc/disksubr.c +++ b/sys/arch/sparc/sparc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.93 2015/01/16 20:17:05 miod Exp $ */ +/* $OpenBSD: disksubr.c,v 1.94 2015/09/27 22:34:27 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */ /* @@ -100,15 +100,9 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), if (spoofonly) goto doslabel; - bp->b_blkno = 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 (biowait(bp)) { - error = bp->b_error; + error = readdisksector(bp, strat, lp, DL_BLKTOSEC(lp, LABELSECTOR)); + if (error) goto done; - } slp = (struct sun_disklabel *)bp->b_data; if (slp->sl_magic == SUN_DKMAGIC) { diff --git a/sys/arch/sparc64/sparc64/disksubr.c b/sys/arch/sparc64/sparc64/disksubr.c index 23398a022db..7a06c516386 100644 --- a/sys/arch/sparc64/sparc64/disksubr.c +++ b/sys/arch/sparc64/sparc64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.69 2015/01/16 20:17:06 miod Exp $ */ +/* $OpenBSD: disksubr.c,v 1.70 2015/09/27 22:34:27 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.13 2000/12/17 22:39:18 pk Exp $ */ /* @@ -93,15 +93,9 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), if (spoofonly) goto doslabel; - bp->b_blkno = 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 (biowait(bp)) { - error = bp->b_error; + error = readdisksector(bp, strat, lp, DL_BLKTOSEC(lp, LABELSECTOR)); + if (error) goto done; - } slp = (struct sun_disklabel *)bp->b_data; if (slp->sl_magic == SUN_DKMAGIC) { |