diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-09-28 15:17:09 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2015-09-28 15:17:09 +0000 |
commit | a20aef2d3d3e933acc04edf2451e5fc56ff57ebb (patch) | |
tree | 4c19687f90371ca2b6c5413ed9c4d8ed54d60a62 /sys/arch/vax | |
parent | 243ffcaf8ce6d5ad0eeb43057aa7030cc508325f (diff) |
Mechanical changes from manual buf set up to readdisksector().
ok deraadt@
Diffstat (limited to 'sys/arch/vax')
-rw-r--r-- | sys/arch/vax/vax/disksubr.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c index b879278e4b5..0d2a4c352b6 100644 --- a/sys/arch/vax/vax/disksubr.c +++ b/sys/arch/vax/vax/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.66 2011/07/06 18:32:59 miod Exp $ */ +/* $OpenBSD: disksubr.c,v 1.67 2015/09/28 15:17:08 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1999/06/30 18:48:06 ragge Exp $ */ /* @@ -73,15 +73,9 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), if (spoofonly) goto done; - 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; - } error = checkdisklabel(bp->b_data + LABELOFFSET, lp, 16, DL_GETDSIZE(lp)); @@ -123,12 +117,8 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp) bp->b_dev = dev; /* Read it in, slap the new label in, and write it back out */ - 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 ((error = biowait(bp)) != 0) + error = readdisksector(bp, strat, lp, DL_BLKTOSEC(lp, LABELSECTOR)); + if (error) goto done; dlp = (struct disklabel *)(bp->b_data + LABELOFFSET); |