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/powerpc | |
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/powerpc')
-rw-r--r-- | sys/arch/powerpc/powerpc/disksubr.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/arch/powerpc/powerpc/disksubr.c b/sys/arch/powerpc/powerpc/disksubr.c index 1bde954d7ab..227df3182b4 100644 --- a/sys/arch/powerpc/powerpc/disksubr.c +++ b/sys/arch/powerpc/powerpc/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.10 1998/03/31 18:21:30 mickey Exp $ */ +/* $OpenBSD: disksubr.c,v 1.11 1998/10/03 21:18:56 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 *)); register struct disklabel *lp; struct cpu_disklabel *osdep; + int spoofonly; { struct dos_partition *dp = osdep->dosparts, *dp2; struct dkbad *bdp = &DKBAD(osdep); @@ -243,6 +244,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; |