diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-10-03 01:37:23 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2006-10-03 01:37:23 +0000 |
commit | 2701db09a71daf730aa4e2da0ed592a141683f35 (patch) | |
tree | 623016f93dacf3f59b06eccd868988cd79a0397f /sys/arch/hppa64 | |
parent | e1ca223320b5c19d983f34c51a654f11c774471a (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/arch/hppa64')
-rw-r--r-- | sys/arch/hppa64/hppa64/disksubr.c | 49 | ||||
-rw-r--r-- | sys/arch/hppa64/include/disklabel.h | 6 |
2 files changed, 2 insertions, 53 deletions
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_ */ |