summaryrefslogtreecommitdiff
path: root/sys/arch/i386
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2006-10-04 00:52:56 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2006-10-04 00:52:56 +0000
commit153f77ea55e24ad85f2095b1697636723b718ca2 (patch)
tree67cb008316638f14def1b489be9e7d3090023963 /sys/arch/i386
parentd527cdf7a9dfcfcb2c3ebcc91972b8a5c98844db (diff)
Zap bad144 bad sector info in disklabels. Sparsely used if at all for
a few obsolete and easily replaced disk models. And didn't work anyway according to Bob, who has tried. ok beck@
Diffstat (limited to 'sys/arch/i386')
-rw-r--r--sys/arch/i386/i386/disksubr.c38
-rw-r--r--sys/arch/i386/include/disklabel.h6
2 files changed, 2 insertions, 42 deletions
diff --git a/sys/arch/i386/i386/disksubr.c b/sys/arch/i386/i386/disksubr.c
index 4808c305d72..6de37cead8d 100644
--- a/sys/arch/i386/i386/disksubr.c
+++ b/sys/arch/i386/i386/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.56 2006/09/19 11:06:33 jsg Exp $ */
+/* $OpenBSD: disksubr.c,v 1.57 2006/10/04 00:52:55 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -65,7 +65,6 @@ readdisklabel(dev_t dev, void (*strat)(struct buf *), struct disklabel *lp,
struct cpu_disklabel *osdep, int spoofonly)
{
struct dos_partition *dp = osdep->dosparts, *dp2;
- struct dkbad *bdp = &DKBAD(osdep);
struct buf *bp = NULL;
struct disklabel *dlp;
char *msg = NULL, *cp;
@@ -277,41 +276,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:
if (bp) {
bp->b_flags |= B_INVAL;
diff --git a/sys/arch/i386/include/disklabel.h b/sys/arch/i386/include/disklabel.h
index 7510dde1d35..63f38be5bf6 100644
--- a/sys/arch/i386/include/disklabel.h
+++ b/sys/arch/i386/include/disklabel.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.h,v 1.28 2006/07/01 16:50:33 krw Exp $ */
+/* $OpenBSD: disklabel.h,v 1.29 2006/10/04 00:52:55 krw Exp $ */
/* $NetBSD: disklabel.h,v 1.3 1996/03/09 20:52:54 ghudson Exp $ */
/*
@@ -84,14 +84,10 @@ struct dos_mbr {
#define DOSMBR_SIGNATURE (0xaa55)
#define DOSMBR_SIGNATURE_OFF (0x1fe)
-#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))