summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2011-07-08 00:08:01 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2011-07-08 00:08:01 +0000
commit5c5174914b126b16e16b71af1fbbccebc9b73074 (patch)
tree7e90f306346903d195e4c1262787b40f5add4c77 /sys/arch
parentdf7b76c43207f6d611a5fe2869bb22159118a660 (diff)
When reading dos labels use DOS_LABELSECTOR and don't use LABELOFFSET. For all these
arch's LABELSECTOR == DOS_LABELSECTOR == 1, and LABELOFFSET == 0. Thus, to quote bob, "This is a no-op". Makes the expression used when writing label the same as the one used in readdoslabel().
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/amd64/amd64/disksubr.c7
-rw-r--r--sys/arch/arm/arm/disksubr.c7
-rw-r--r--sys/arch/aviion/aviion/disksubr.c7
-rw-r--r--sys/arch/hppa/hppa/disksubr.c6
-rw-r--r--sys/arch/hppa64/hppa64/disksubr.c6
-rw-r--r--sys/arch/i386/i386/disksubr.c7
-rw-r--r--sys/arch/landisk/landisk/disksubr.c7
-rw-r--r--sys/arch/loongson/loongson/disksubr.c7
-rw-r--r--sys/arch/macppc/macppc/disksubr.c6
-rw-r--r--sys/arch/octeon/octeon/disksubr.c7
-rw-r--r--sys/arch/sgi/sgi/disksubr.c7
-rw-r--r--sys/arch/socppc/socppc/disksubr.c7
12 files changed, 45 insertions, 36 deletions
diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c
index 60dc3e18494..793b00db6ae 100644
--- a/sys/arch/amd64/amd64/disksubr.c
+++ b/sys/arch/amd64/amd64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.63 2011/07/06 00:48:55 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.64 2011/07/08 00:08:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -134,8 +134,9 @@ 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+LABELSECTOR) * DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ 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);
diff --git a/sys/arch/arm/arm/disksubr.c b/sys/arch/arm/arm/disksubr.c
index e6e678015d5..1a311cb847e 100644
--- a/sys/arch/arm/arm/disksubr.c
+++ b/sys/arch/arm/arm/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.57 2011/07/06 15:26:50 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.58 2011/07/08 00:08:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -109,8 +109,9 @@ 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+LABELSECTOR) * DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ 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);
diff --git a/sys/arch/aviion/aviion/disksubr.c b/sys/arch/aviion/aviion/disksubr.c
index 09917777805..c7d9c63ae21 100644
--- a/sys/arch/aviion/aviion/disksubr.c
+++ b/sys/arch/aviion/aviion/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.50 2011/07/06 15:26:50 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.51 2011/07/08 00:08:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -109,8 +109,9 @@ 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+LABELSECTOR) * DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ 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);
diff --git a/sys/arch/hppa/hppa/disksubr.c b/sys/arch/hppa/hppa/disksubr.c
index 2ca75fa3471..6d384208ca8 100644
--- a/sys/arch/hppa/hppa/disksubr.c
+++ b/sys/arch/hppa/hppa/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.81 2011/07/07 22:48:23 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.82 2011/07/08 00:08:00 krw Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -264,9 +264,9 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp)
bp->b_blkno = partoff + LABELSECTOR;
offset = LABELOFFSET;
} else if (readdoslabel(bp, strat, lp, &partoff, 1) == 0) {
- bp->b_blkno = DL_BLKTOSEC(lp, partoff + LABELSECTOR) *
+ bp->b_blkno = DL_BLKTOSEC(lp, partoff + DOS_LABELSECTOR) *
DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ offset = DL_BLKOFFSET(lp, partoff + DOS_LABELSECTOR);
} else
goto done;
diff --git a/sys/arch/hppa64/hppa64/disksubr.c b/sys/arch/hppa64/hppa64/disksubr.c
index 4acfe93e904..84674497c91 100644
--- a/sys/arch/hppa64/hppa64/disksubr.c
+++ b/sys/arch/hppa64/hppa64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.65 2011/07/07 22:48:23 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.66 2011/07/08 00:08:00 krw Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -264,9 +264,9 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp)
bp->b_blkno = partoff + LABELSECTOR;
offset = LABELOFFSET;
} else if (readdoslabel(bp, strat, lp, &partoff, 1) == 0) {
- bp->b_blkno = DL_BLKTOSEC(lp, partoff + LABELSECTOR) *
+ bp->b_blkno = DL_BLKTOSEC(lp, partoff + DOS_LABELSECTOR) *
DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ offset = DL_BLKOFFSET(lp, partoff + DOS_LABELSECTOR);
} else
goto done;
diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c
index 479480959bf..3134fa90859 100644
--- a/sys/arch/i386/i386/disksubr.c
+++ b/sys/arch/i386/i386/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.103 2011/04/16 03:21:15 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.104 2011/07/08 00:08:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -136,8 +136,9 @@ 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+LABELSECTOR) * DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ 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);
diff --git a/sys/arch/landisk/landisk/disksubr.c b/sys/arch/landisk/landisk/disksubr.c
index 61f5a5869ea..e2c7a7464bc 100644
--- a/sys/arch/landisk/landisk/disksubr.c
+++ b/sys/arch/landisk/landisk/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.45 2011/07/06 15:26:50 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.46 2011/07/08 00:08:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -109,8 +109,9 @@ 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+LABELSECTOR) * DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ 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);
diff --git a/sys/arch/loongson/loongson/disksubr.c b/sys/arch/loongson/loongson/disksubr.c
index d592707e693..482225b8d07 100644
--- a/sys/arch/loongson/loongson/disksubr.c
+++ b/sys/arch/loongson/loongson/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.6 2011/07/06 15:26:50 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.7 2011/07/08 00:08:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -109,8 +109,9 @@ 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+LABELSECTOR) * DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ 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);
diff --git a/sys/arch/macppc/macppc/disksubr.c b/sys/arch/macppc/macppc/disksubr.c
index b73a12ccfb3..e720ea76437 100644
--- a/sys/arch/macppc/macppc/disksubr.c
+++ b/sys/arch/macppc/macppc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.73 2011/07/07 22:48:23 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.74 2011/07/08 00:08:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -206,9 +206,9 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp)
bp->b_blkno = partoff + LABELSECTOR;
offset = LABELOFFSET;
} else if (readdoslabel(bp, strat, lp, &partoff, 1) == 0) {
- bp->b_blkno = DL_BLKTOSEC(lp, partoff + LABELSECTOR) *
+ bp->b_blkno = DL_BLKTOSEC(lp, partoff + DOS_LABELSECTOR) *
DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ offset = DL_BLKOFFSET(lp, partoff + DOS_LABELSECTOR);
} else
goto done;
diff --git a/sys/arch/octeon/octeon/disksubr.c b/sys/arch/octeon/octeon/disksubr.c
index d592707e693..482225b8d07 100644
--- a/sys/arch/octeon/octeon/disksubr.c
+++ b/sys/arch/octeon/octeon/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.6 2011/07/06 15:26:50 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.7 2011/07/08 00:08:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -109,8 +109,9 @@ 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+LABELSECTOR) * DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ 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);
diff --git a/sys/arch/sgi/sgi/disksubr.c b/sys/arch/sgi/sgi/disksubr.c
index 2e2ad60ccb0..6a2269f79d7 100644
--- a/sys/arch/sgi/sgi/disksubr.c
+++ b/sys/arch/sgi/sgi/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.23 2011/04/16 03:21:15 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.24 2011/07/08 00:08:00 krw Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -229,8 +229,9 @@ 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+LABELSECTOR) * DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ 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);
diff --git a/sys/arch/socppc/socppc/disksubr.c b/sys/arch/socppc/socppc/disksubr.c
index 0e3ed5ee7bb..39cbf01988a 100644
--- a/sys/arch/socppc/socppc/disksubr.c
+++ b/sys/arch/socppc/socppc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.17 2011/07/06 15:26:50 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.18 2011/07/08 00:08:00 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -109,8 +109,9 @@ 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+LABELSECTOR) * DL_BLKSPERSEC(lp);
- offset = DL_BLKOFFSET(lp, partoff + LABELSECTOR) + LABELOFFSET;
+ 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);