summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2001-10-15 04:03:46 +0000
committerJason Wright <jason@cvs.openbsd.org>2001-10-15 04:03:46 +0000
commit400f498bde6992f91645abbde07b6d7ba4ae7c07 (patch)
treeb11e77431742aefedaee390018b09a3901470539 /sys/arch
parent641b65e6f545ea0a415b017af8caa5a31f1d6319 (diff)
Make the test for iso9660 filesystems preferred if the device is a CD,
and use old behavior otherwise (check for sun label, then native label, then iso label).
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc/sparc/disksubr.c14
-rw-r--r--sys/arch/sparc64/sparc64/disksubr.c16
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");
}