summaryrefslogtreecommitdiff
path: root/sys/arch/amd64/amd64/disksubr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/amd64/amd64/disksubr.c')
-rw-r--r--sys/arch/amd64/amd64/disksubr.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/sys/arch/amd64/amd64/disksubr.c b/sys/arch/amd64/amd64/disksubr.c
index a7a3e77ad73..ff9c477ba7c 100644
--- a/sys/arch/amd64/amd64/disksubr.c
+++ b/sys/arch/amd64/amd64/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.14 2006/09/16 14:56:11 krw Exp $ */
+/* $OpenBSD: disksubr.c,v 1.15 2006/10/04 00:52:55 krw Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -69,7 +69,6 @@ readdisklabel(dev, strat, lp, osdep, spoofonly)
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;
@@ -281,41 +280,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;