diff options
-rw-r--r-- | sys/arch/sparc/sparc/disksubr.c | 14 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/disksubr.c | 16 |
2 files changed, 26 insertions, 4 deletions
diff --git a/sys/arch/sparc/sparc/disksubr.c b/sys/arch/sparc/sparc/disksubr.c index 440fd75f85a..ba941b0bc80 100644 --- a/sys/arch/sparc/sparc/disksubr.c +++ b/sys/arch/sparc/sparc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.25 2001/06/26 22:31:47 miod Exp $ */ +/* $OpenBSD: disksubr.c,v 1.26 2001/10/15 04:03:45 jason Exp $ */ /* $NetBSD: disksubr.c,v 1.16 1996/04/28 20:25:59 thorpej Exp $ */ /* @@ -52,6 +52,7 @@ #endif #include <sparc/dev/sbusvar.h> +#include "cd.h" #if MAXPARTITIONS != 16 #warn beware: Sun disklabel compatibility assumes MAXPARTITIONS == 16 @@ -119,6 +120,11 @@ dk_establish(dk, dev) } } +#if NCD > 0 +/* XXX for comparison below. */ +extern void cdstrategy __P((struct buf *)); +#endif + /* * Attempt to read a disk label from a device * using the indicated strategy routine. @@ -184,6 +190,12 @@ readdisklabel(dev, strat, lp, clp, spoofonly) if (error) return ("disk label read error"); +#if defined(CD9660) && (NCD > 0) + if ((strat == cdstrategy) && + (iso_disklabelspoof(dev, strat, lp) == NULL)) + return (NULL); +#endif + /* Check for a Sun disk label (for PROM compatibility). */ slp = (struct sun_disklabel *) clp->cd_block; if (slp->sl_magic == SUN_DKMAGIC) diff --git a/sys/arch/sparc64/sparc64/disksubr.c b/sys/arch/sparc64/sparc64/disksubr.c index 585eb2892bb..6e76151b3a4 100644 --- a/sys/arch/sparc64/sparc64/disksubr.c +++ b/sys/arch/sparc64/sparc64/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.5 2001/10/12 20:32:11 jason Exp $ */ +/* $OpenBSD: disksubr.c,v 1.6 2001/10/15 04:03:45 jason Exp $ */ /* $NetBSD: disksubr.c,v 1.13 2000/12/17 22:39:18 pk Exp $ */ /* @@ -53,6 +53,7 @@ #endif #include <dev/sbus/sbusvar.h> +#include "cd.h" static char *disklabel_sun_to_bsd __P((char *, struct disklabel *)); static int disklabel_bsd_to_sun __P((struct disklabel *, char *)); @@ -66,6 +67,10 @@ dk_establish(struct disk *dk, struct device *dev) /* fix later */ } +#if NCD > 0 +extern void cdstrategy __P((struct buf *)); +#endif + /* * Attempt to read a disk label from a device * using the indicated stategy routine. @@ -109,8 +114,9 @@ readdisklabel(dev, strat, lp, clp, spoofonly) if (spoofonly) return (NULL); -#if defined(CD9660) - if (iso_disklabelspoof(dev, strat, lp) == 0) +#if defined(CD9660) && (NCD > 0) + if ((strat == cdstrategy) && + (iso_disklabelspoof(dev, strat, lp) == NULL)) return (NULL); #endif @@ -149,6 +155,10 @@ readdisklabel(dev, strat, lp, clp, spoofonly) return (NULL); } +#if defined(CD9660) + if (iso_disklabelspoof(dev, strat, lp) == NULL) + return (NULL); +#endif bzero(clp->cd_block, sizeof(clp->cd_block)); return ("no disk label"); } |