diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-10-03 21:19:02 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-10-03 21:19:02 +0000 |
commit | 2847382ad0f79d42676104f5b99c1b14a78a5b90 (patch) | |
tree | 3e173e06925848427cc197fb15b7a2d7b3e5c12c /sys/arch/mac68k | |
parent | 17219f15915dee86717b444ef5a7e0c11c2e9bb4 (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/mac68k')
-rw-r--r-- | sys/arch/mac68k/mac68k/disksubr.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/arch/mac68k/mac68k/disksubr.c b/sys/arch/mac68k/mac68k/disksubr.c index d79a5abb3d6..b541b841147 100644 --- a/sys/arch/mac68k/mac68k/disksubr.c +++ b/sys/arch/mac68k/mac68k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.8 1998/02/14 07:01:06 gene Exp $ */ +/* $OpenBSD: disksubr.c,v 1.9 1998/10/03 21:18:55 millert Exp $ */ /* $NetBSD: disksubr.c,v 1.22 1997/11/26 04:18:20 briggs Exp $ */ /* @@ -474,11 +474,12 @@ done: * then we assume that it's a real disklabel and return it. */ char * -readdisklabel(dev, strat, lp, osdep) +readdisklabel(dev, strat, lp, osdep, spoofonly) dev_t dev; void (*strat)(struct buf *); register struct disklabel *lp; struct cpu_disklabel *osdep; + int spoofonly; { register struct buf *bp; char *msg = NULL; @@ -490,6 +491,11 @@ readdisklabel(dev, strat, lp, osdep) if (lp->d_secpercyl == 0) { return msg = "Zero secpercyl"; } + + /* don't read the on-disk label if we are in spoofed-only mode */ + if (spoofonly) + return (NULL); + bp = geteblk((int)lp->d_secsize * MAXPARTITIONS); bp->b_dev = dev; |