summaryrefslogtreecommitdiff
path: root/sys/arch/hppa64
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-06-07 02:55:13 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-06-07 02:55:13 +0000
commit572bcf7550756be8a3c77f603b85107ecd0ed711 (patch)
tree9783b5b60d44f323766a8138d156c885cf9ee152 /sys/arch/hppa64
parent82e0666f1407874b64db25cbcb158c5e7b685c2f (diff)
Eliminate unnecessary duplicate defines *_LABELSECTOR and
*_LABELOFFSET. Don't use osdep->labelsector since it will always be LABELSECTOR, since we don't support extended DOS partitions holding the OpenBSD disk label. No functional change. Now only Alpha and Vax bounds_check_with_label differ by more than comments.
Diffstat (limited to 'sys/arch/hppa64')
-rw-r--r--sys/arch/hppa64/hppa64/disksubr.c26
-rw-r--r--sys/arch/hppa64/include/disklabel.h11
2 files changed, 11 insertions, 26 deletions
diff --git a/sys/arch/hppa64/hppa64/disksubr.c b/sys/arch/hppa64/hppa64/disksubr.c
index d99940532b2..9feb21e710d 100644
--- a/sys/arch/hppa64/hppa64/disksubr.c
+++ b/sys/arch/hppa64/hppa64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.39 2007/06/07 00:28:17 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.40 2007/06/07 02:55:12 krw Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -166,10 +166,6 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *),
*lp = minilabel;
}
}
- /* Record metainformation about the disklabel. */
- if (msg == NULL) {
- osdep->labelsector = bp->b_blkno;
- }
#if defined(CD9660)
if (msg && iso_disklabelspoof(dev, strat, lp) == 0)
@@ -227,7 +223,7 @@ readdoslabel(struct buf *bp, void (*strat)(struct buf *),
/* do dos partitions in the process of getting disklabel? */
dospartoff = 0;
- cyl = I386_LABELSECTOR / lp->d_secpercyl;
+ cyl = LABELSECTOR / lp->d_secpercyl;
/*
* Read dos partition table, follow extended partitions.
@@ -382,7 +378,7 @@ notfat:
*cylp = cyl;
/* next, dig out disk label */
- msg = readbsdlabel(bp, strat, cyl, dospartoff + I386_LABELSECTOR, -1,
+ msg = readbsdlabel(bp, strat, cyl, dospartoff + LABELSECTOR, -1,
lp, spoofonly);
return (msg);
@@ -541,8 +537,8 @@ readliflabel(struct buf *bp, void (*strat)(struct buf *),
if (partoffp)
*partoffp = fsoff;
- return readbsdlabel(bp, strat, 0, fsoff + HPPA_LABELSECTOR,
- HPPA_LABELOFFSET, lp, spoofonly);
+ return readbsdlabel(bp, strat, 0, fsoff + LABELSECTOR,
+ LABELOFFSET, lp, spoofonly);
}
/*
@@ -624,19 +620,13 @@ writedisklabel(dev_t dev, void (*strat)(struct buf *),
bp = geteblk((int)lp->d_secsize);
bp->b_dev = dev;
- /*
- * I once played with the thought of using osdep->label{tag,sector}
- * as a cache for knowing where (and what) to write. However, now I
- * think it might be useful to reprobe if someone has written
- * a newer disklabel of another type with disklabel(8) and -r.
- */
dl = *lp;
msg = readliflabel(bp, strat, &dl, &cdl, &partoff, &cyl, 0);
- labeloffset = HPPA_LABELOFFSET;
+ labeloffset = LABELOFFSET;
if (msg) {
dl = *lp;
msg = readdoslabel(bp, strat, &dl, &cdl, &partoff, &cyl, 0);
- labeloffset = I386_LABELOFFSET;
+ labeloffset = LABELOFFSET;
}
if (msg) {
if (partoff == -1)
@@ -672,7 +662,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp,
#define blockpersec(count, lp) ((count) * (((lp)->d_secsize) / DEV_BSIZE))
struct partition *p = lp->d_partitions + DISKPART(bp->b_dev);
int labelsector = blockpersec(DL_GETPOFFSET(&lp->d_partitions[RAW_PART]), lp) +
- osdep->labelsector;
+ LABELSECTOR;
int sz = howmany(bp->b_bcount, DEV_BSIZE);
/* avoid division by zero */
diff --git a/sys/arch/hppa64/include/disklabel.h b/sys/arch/hppa64/include/disklabel.h
index 9004cc4183b..83ea80baf88 100644
--- a/sys/arch/hppa64/include/disklabel.h
+++ b/sys/arch/hppa64/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.10 2006/10/20 23:47:42 krw Exp $ */
+/* $OpenBSD: disklabel.h,v 1.11 2007/06/07 02:55:12 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.1 1995/02/13 23:07:34 cgd Exp $ */
/*
@@ -34,13 +34,8 @@
#ifndef _MACHINE_DISKLABEL_H_
#define _MACHINE_DISKLABEL_H_
-#define HPPA_LABELSECTOR 1 /* sector containing label */
-#define HPPA_LABELOFFSET 0 /* offset of label in sector */
-#define I386_LABELSECTOR 1 /* sector containing label */
-#define I386_LABELOFFSET 0 /* offset of label in sector */
-
-#define LABELSECTOR HPPA_LABELSECTOR
-#define LABELOFFSET HPPA_LABELOFFSET
+#define LABELSECTOR 1
+#define LABELOFFSET 0
#define MAXPARTITIONS 16 /* number of partitions */
#define RAW_PART 2 /* raw partition: xx?c */