summaryrefslogtreecommitdiff
path: root/sys/arch/mips
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-10-03 21:19:02 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-10-03 21:19:02 +0000
commit2847382ad0f79d42676104f5b99c1b14a78a5b90 (patch)
tree3e173e06925848427cc197fb15b7a2d7b3e5c12c /sys/arch/mips
parent17219f15915dee86717b444ef5a7e0c11c2e9bb4 (diff)
Add a "spoofonly" argument to readdisklabel() which will be used to
implement an ioctl to get a spoofed label even for disks that have a label on them.
Diffstat (limited to 'sys/arch/mips')
-rw-r--r--sys/arch/mips/mips/disksubr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/mips/mips/disksubr.c b/sys/arch/mips/mips/disksubr.c
index 45d27a1fe34..a3a748829ce 100644
--- a/sys/arch/mips/mips/disksubr.c
+++ b/sys/arch/mips/mips/disksubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disksubr.c,v 1.5 1998/03/16 09:03:29 pefo Exp $ */
+/* $OpenBSD: disksubr.c,v 1.6 1998/10/03 21:18:55 millert Exp $ */
/* $NetBSD: disksubr.c,v 1.21 1996/05/03 19:42:03 christos Exp $ */
/*
@@ -77,11 +77,12 @@ dk_establish(dk, dev)
* Returns null on success and an error string on failure.
*/
char *
-readdisklabel(dev, strat, lp, osdep)
+readdisklabel(dev, strat, lp, osdep, spoofonly)
dev_t dev;
void (*strat) __P((struct buf *));
struct disklabel *lp;
struct cpu_disklabel *osdep;
+ int spoofonly;
{
struct dos_partition *dp = osdep->dosparts, *dp2;
struct dkbad *bdp = &DKBAD(osdep);
@@ -244,6 +245,10 @@ donot:
lp->d_npartitions = MAXPARTITIONS;
}
+ /* don't read the on-disk label if we are in spoofed-only mode */
+ if (spoofonly)
+ goto done;
+
/* next, dig out disk label */
bp->b_blkno = dospartoff + LABELSECTOR;
bp->b_cylin = cyl;