summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2006-10-03 01:37:23 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2006-10-03 01:37:23 +0000
commit2701db09a71daf730aa4e2da0ed592a141683f35 (patch)
tree623016f93dacf3f59b06eccd868988cd79a0397f /sys
parente1ca223320b5c19d983f34c51a654f11c774471a (diff)
Don't load bad144 bad sector information into disklabels for archs that
don't have wd* in GENERIC, since wd* is the only place such info is being used. First step of eliminating bad144 bad sector info from all disklabels. 'go go go' deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/aviion/include/disklabel.h5
-rw-r--r--sys/arch/hppa64/hppa64/disksubr.c49
-rw-r--r--sys/arch/hppa64/include/disklabel.h6
-rw-r--r--sys/arch/mips64/include/disklabel.h6
-rw-r--r--sys/arch/mips64/mips64/disksubr.c49
-rw-r--r--sys/arch/mvmeppc/include/disklabel.h6
-rw-r--r--sys/arch/mvmeppc/mvmeppc/disksubr.c38
7 files changed, 7 insertions, 152 deletions
diff --git a/sys/arch/aviion/include/disklabel.h b/sys/arch/aviion/include/disklabel.h
index c5ae83c7559..061b43f4543 100644
--- a/sys/arch/aviion/include/disklabel.h
+++ b/sys/arch/aviion/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.3 2006/07/01 16:50:33 krw Exp $ */
+/* $OpenBSD: disklabel.h,v 1.4 2006/10/03 01:37:22 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.2 2001/11/25 19:02:03 thorpej Exp $ */
/*
@@ -52,8 +52,6 @@
#define MAXPARTITIONS 16 /* number of partitions */
#define RAW_PART 2 /* raw partition: XX?c */
-#include <sys/dkbad.h>
-
/* MBR partition table */
#define DOSBBSECTOR 0 /* MBR sector number */
#define DOSPARTOFF 446 /* Offset of MBR partition table */
@@ -99,7 +97,6 @@ struct dos_partition {
struct cpu_disklabel {
struct dos_partition dosparts[NDOSPART];
- struct dkbad bad;
};
#endif /* _AVIION_DISKLABEL_H_ */
diff --git a/sys/arch/hppa64/hppa64/disksubr.c b/sys/arch/hppa64/hppa64/disksubr.c
index 93d4560534d..5f1af4766b9 100644
--- a/sys/arch/hppa64/hppa64/disksubr.c
+++ b/sys/arch/hppa64/hppa64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.16 2006/09/16 14:56:11 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.17 2006/10/03 01:37:22 krw Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -219,7 +219,6 @@ readdoslabel(bp, strat, lp, osdep, partoffp, cylp, spoofonly)
int spoofonly;
{
struct dos_partition *dp = osdep->u._i386.dosparts, *dp2;
- struct dkbad *db, *bdp = &DKBAD(osdep);
char *msg = NULL, *cp;
int dospartoff, cyl, i, ourpart = -1;
dev_t dev;
@@ -388,53 +387,7 @@ donot:
/* next, dig out disk label */
msg = readbsdlabel(bp, strat, cyl, dospartoff + I386_LABELSECTOR, -1,
lp, spoofonly);
- if (msg)
- return (msg);
- /* obtain bad sector table if requested and present */
- if (bdp && (lp->d_flags & D_BADSECT)) {
- /*
- * get a new buffer and initialize it as callers trust the
- * buffer given to us, to point at the disklabel sector.
- */
- dev = bp->b_dev;
- bp = geteblk((int)lp->d_secsize);
- bp->b_dev = dev;
-
- i = 0;
- do {
- /* read a bad sector table */
- bp->b_flags = B_BUSY | B_READ;
- bp->b_blkno = lp->d_secperunit - lp->d_nsectors + i;
- if (lp->d_secsize > DEV_BSIZE)
- bp->b_blkno *= lp->d_secsize / DEV_BSIZE;
- else
- bp->b_blkno /= DEV_BSIZE / lp->d_secsize;
- bp->b_bcount = lp->d_secsize;
- bp->b_cylinder = lp->d_ncylinders - 1;
- (*strat)(bp);
-
- /* if successful, validate, otherwise try another */
- if (biowait(bp))
- msg = "bad sector table I/O error";
- else {
- db = (struct dkbad *)(bp->b_data);
-#define DKBAD_MAGIC 0x4321
- if (db->bt_mbz == 0 &&
- db->bt_flag == DKBAD_MAGIC) {
- msg = NULL;
- *bdp = *db;
- break;
- } else
- msg = "bad sector table corrupted";
- }
- } while ((bp->b_flags & B_ERROR) && (i += 2) < 10 &&
- i < lp->d_nsectors);
-
- /* Give back the bad block buffer. */
- bp->b_flags |= B_INVAL;
- brelse(bp);
- }
return (msg);
}
#endif
diff --git a/sys/arch/hppa64/include/disklabel.h b/sys/arch/hppa64/include/disklabel.h
index 051dbe2865b..ef2437b2500 100644
--- a/sys/arch/hppa64/include/disklabel.h
+++ b/sys/arch/hppa64/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.6 2006/07/07 23:47:37 krw Exp $ */
+/* $OpenBSD: disklabel.h,v 1.7 2006/10/03 01:37:22 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.1 1995/02/13 23:07:34 cgd Exp $ */
/*
@@ -175,13 +175,11 @@ struct hpux_label {
#define lifstob(s) ((s) * LIF_SECTSIZE)
#define lifstodb(s) ((s) * LIF_SECTSIZE / DEV_BSIZE)
-#include <sys/dkbad.h>
struct cpu_disklabel {
int labelsector;
union {
struct {
struct dos_partition dosparts[NDOSPART];
- struct dkbad bad;
} _i386;
struct {
struct lifvol lifvol;
@@ -191,6 +189,4 @@ struct cpu_disklabel {
} u;
};
-#define DKBAD(x) ((x)->u._i386.bad)
-
#endif /* _MACHINE_DISKLABEL_H_ */
diff --git a/sys/arch/mips64/include/disklabel.h b/sys/arch/mips64/include/disklabel.h
index 5eb868d0e2f..d847519c48c 100644
--- a/sys/arch/mips64/include/disklabel.h
+++ b/sys/arch/mips64/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.8 2006/07/07 23:47:37 krw Exp $ */
+/* $OpenBSD: disklabel.h,v 1.9 2006/10/03 01:37:22 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.1 1995/02/13 23:07:34 cgd Exp $ */
/*
@@ -147,17 +147,13 @@ struct sgilabel {
#define SGI_PTYPE_XVM 13
-#include <sys/dkbad.h>
struct cpu_disklabel {
int labelsector;
union {
struct {
struct dos_partition dosparts[NDOSPART];
- struct dkbad bad;
} _i386;
} u;
};
-#define DKBAD(x) ((x)->u._i386.bad)
-
#endif /* _MACHINE_DISKLABEL_H_ */
diff --git a/sys/arch/mips64/mips64/disksubr.c b/sys/arch/mips64/mips64/disksubr.c
index 28d7c2e714c..189281aa41f 100644
--- a/sys/arch/mips64/mips64/disksubr.c
+++ b/sys/arch/mips64/mips64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.22 2006/09/16 14:56:12 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.23 2006/10/03 01:37:22 krw Exp $ */
/*
* Copyright (c) 1999 Michael Shalayeff
@@ -227,7 +227,6 @@ readdoslabel(bp, strat, lp, osdep, partoffp, cylp, spoofonly)
int spoofonly;
{
struct dos_partition *dp = osdep->u._i386.dosparts, *dp2;
- struct dkbad *db, *bdp = &DKBAD(osdep);
char *msg = NULL, *cp;
int dospartoff, cyl, i, ourpart = -1;
dev_t dev;
@@ -396,53 +395,7 @@ donot:
/* next, dig out disk label */
msg = readbsdlabel(bp, strat, cyl, dospartoff + I386_LABELSECTOR, -1,
lp, spoofonly);
- if (msg)
- return (msg);
-
- /* obtain bad sector table if requested and present */
- if (bdp && (lp->d_flags & D_BADSECT)) {
- /*
- * get a new buffer and initialize it as callers trust the
- * buffer given to us, to point at the disklabel sector.
- */
- dev = bp->b_dev;
- bp = geteblk((int)lp->d_secsize);
- bp->b_dev = dev;
- i = 0;
- do {
- /* read a bad sector table */
- bp->b_flags = B_BUSY | B_READ;
- bp->b_blkno = lp->d_secperunit - lp->d_nsectors + i;
- if (lp->d_secsize > DEV_BSIZE)
- bp->b_blkno *= lp->d_secsize / DEV_BSIZE;
- else
- bp->b_blkno /= DEV_BSIZE / lp->d_secsize;
- bp->b_bcount = lp->d_secsize;
- bp->b_cylinder = lp->d_ncylinders - 1;
- (*strat)(bp);
-
- /* if successful, validate, otherwise try another */
- if (biowait(bp))
- msg = "bad sector table I/O error";
- else {
- db = (struct dkbad *)(bp->b_data);
-#define DKBAD_MAGIC 0x4321
- if (db->bt_mbz == 0 &&
- db->bt_flag == DKBAD_MAGIC) {
- msg = NULL;
- *bdp = *db;
- break;
- } else
- msg = "bad sector table corrupted";
- }
- } while ((bp->b_flags & B_ERROR) && (i += 2) < 10 &&
- i < lp->d_nsectors);
-
- /* Give back the bad block buffer. */
- bp->b_flags |= B_INVAL;
- brelse(bp);
- }
return (msg);
}
#endif
diff --git a/sys/arch/mvmeppc/include/disklabel.h b/sys/arch/mvmeppc/include/disklabel.h
index f5cdc205ec5..f8ce2503b3a 100644
--- a/sys/arch/mvmeppc/include/disklabel.h
+++ b/sys/arch/mvmeppc/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.6 2006/07/01 16:50:33 krw Exp $ */
+/* $OpenBSD: disklabel.h,v 1.7 2006/10/03 01:37:22 krw Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -78,14 +78,10 @@ struct dos_partition {
#define DOSPTYP_OPENBSD 0xa6 /* OpenBSD partition type */
#define DOSPTYP_NETBSD 0xa9 /* NetBSD partition type */
-#include <sys/dkbad.h>
struct cpu_disklabel {
struct dos_partition dosparts[NDOSPART];
- struct dkbad bad;
};
-#define DKBAD(x) ((x)->bad)
-
/* Isolate the relevant bits to get sector and cylinder. */
#define DPSECT(s) ((s) & 0x3f)
#define DPCYL(c, s) ((c) + (((s) & 0xc0) << 2))
diff --git a/sys/arch/mvmeppc/mvmeppc/disksubr.c b/sys/arch/mvmeppc/mvmeppc/disksubr.c
index 988c08d07b3..b063ae0f0c3 100644
--- a/sys/arch/mvmeppc/mvmeppc/disksubr.c
+++ b/sys/arch/mvmeppc/mvmeppc/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.18 2006/09/16 14:56:12 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.19 2006/10/03 01:37:22 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -72,7 +72,6 @@ readdisklabel(dev, strat, lp, osdep, spoofonly)
int spoofonly;
{
struct dos_partition *dp = osdep->dosparts, *dp2;
- struct dkbad *bdp = &DKBAD(osdep);
struct buf *bp;
struct disklabel *dlp;
char *msg = NULL, *cp;
@@ -283,41 +282,6 @@ donot:
goto done;
}
- /* obtain bad sector table if requested and present */
- if (bdp && (lp->d_flags & D_BADSECT)) {
- struct dkbad *db;
-
- i = 0;
- do {
- /* read a bad sector table */
- bp->b_flags = B_BUSY | B_READ;
- bp->b_blkno = lp->d_secperunit - lp->d_nsectors + i;
- if (lp->d_secsize > DEV_BSIZE)
- bp->b_blkno *= lp->d_secsize / DEV_BSIZE;
- else
- bp->b_blkno /= DEV_BSIZE / lp->d_secsize;
- bp->b_bcount = lp->d_secsize;
- bp->b_cylinder = lp->d_ncylinders - 1;
- (*strat)(bp);
-
- /* if successful, validate, otherwise try another */
- if (biowait(bp)) {
- msg = "bad sector table I/O error";
- } else {
- db = (struct dkbad *)(bp->b_data);
-#define DKBAD_MAGIC 0x4321
- if (db->bt_mbz == 0
- && db->bt_flag == DKBAD_MAGIC) {
- msg = NULL;
- *bdp = *db;
- break;
- } else
- msg = "bad sector table corrupted";
- }
- } while ((bp->b_flags & B_ERROR) && (i += 2) < 10 &&
- i < lp->d_nsectors);
- }
-
done:
bp->b_flags |= B_INVAL;
brelse(bp);