summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/subr_disklabel.c13
-rw-r--r--sys/ufs/ufs/ufs_disksubr.c13
2 files changed, 8 insertions, 18 deletions
diff --git a/sys/kern/subr_disklabel.c b/sys/kern/subr_disklabel.c
index 3eecb30..8a2de14 100644
--- a/sys/kern/subr_disklabel.c
+++ b/sys/kern/subr_disklabel.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94
- * $Id: ufs_disksubr.c,v 1.36 1998/09/15 08:55:03 gibbs Exp $
+ * $Id: ufs_disksubr.c,v 1.37 1998/10/16 10:14:21 jkh Exp $
*/
#include <sys/param.h>
@@ -269,17 +269,12 @@ writedisklabel(dev, strat, lp)
{
struct buf *bp;
struct disklabel *dlp;
- int labelpart;
int error = 0;
- labelpart = dkpart(dev);
- if (lp->d_partitions[labelpart].p_offset != 0) {
- if (lp->d_partitions[0].p_offset != 0)
- return (EXDEV); /* not quite right */
- labelpart = 0;
- }
+ if (lp->d_partitions[RAW_PART].p_offset != 0)
+ return (EXDEV); /* not quite right */
bp = geteblk((int)lp->d_secsize);
- bp->b_dev = dkmodpart(dev, labelpart);
+ bp->b_dev = dkmodpart(dev, RAW_PART);
bp->b_blkno = LABELSECTOR * ((int)lp->d_secsize/DEV_BSIZE);
bp->b_bcount = lp->d_secsize;
#if 1
diff --git a/sys/ufs/ufs/ufs_disksubr.c b/sys/ufs/ufs/ufs_disksubr.c
index 3eecb30..8a2de14 100644
--- a/sys/ufs/ufs/ufs_disksubr.c
+++ b/sys/ufs/ufs/ufs_disksubr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)ufs_disksubr.c 8.5 (Berkeley) 1/21/94
- * $Id: ufs_disksubr.c,v 1.36 1998/09/15 08:55:03 gibbs Exp $
+ * $Id: ufs_disksubr.c,v 1.37 1998/10/16 10:14:21 jkh Exp $
*/
#include <sys/param.h>
@@ -269,17 +269,12 @@ writedisklabel(dev, strat, lp)
{
struct buf *bp;
struct disklabel *dlp;
- int labelpart;
int error = 0;
- labelpart = dkpart(dev);
- if (lp->d_partitions[labelpart].p_offset != 0) {
- if (lp->d_partitions[0].p_offset != 0)
- return (EXDEV); /* not quite right */
- labelpart = 0;
- }
+ if (lp->d_partitions[RAW_PART].p_offset != 0)
+ return (EXDEV); /* not quite right */
bp = geteblk((int)lp->d_secsize);
- bp->b_dev = dkmodpart(dev, labelpart);
+ bp->b_dev = dkmodpart(dev, RAW_PART);
bp->b_blkno = LABELSECTOR * ((int)lp->d_secsize/DEV_BSIZE);
bp->b_bcount = lp->d_secsize;
#if 1
OpenPOWER on IntegriCloud