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/vax | |
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/vax')
-rw-r--r-- | sys/arch/vax/mba/hp.c | 4 | ||||
-rw-r--r-- | sys/arch/vax/mscp/mscp_disk.c | 4 | ||||
-rw-r--r-- | sys/arch/vax/vax/disksubr.c | 9 |
3 files changed, 11 insertions, 6 deletions
diff --git a/sys/arch/vax/mba/hp.c b/sys/arch/vax/mba/hp.c index 186faed847a..633d6a04aa5 100644 --- a/sys/arch/vax/mba/hp.c +++ b/sys/arch/vax/mba/hp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hp.c,v 1.8 1997/09/12 09:23:59 maja Exp $ */ +/* $OpenBSD: hp.c,v 1.9 1998/10/03 21:18:59 millert Exp $ */ /* $NetBSD: hp.c,v 1.15 1997/06/24 01:09:37 thorpej Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. @@ -163,7 +163,7 @@ hpattach(parent, self, aux) * Read in label. */ if ((msg = readdisklabel(makedev(0, self->dv_unit * 8), hpstrategy, - dl, NULL)) != NULL) + dl, NULL, 0)) != NULL) printf(": %s", msg); printf(": %s, size = %d sectors\n", dl->d_typename, dl->d_secperunit); /* diff --git a/sys/arch/vax/mscp/mscp_disk.c b/sys/arch/vax/mscp/mscp_disk.c index 11644806151..24450c28d67 100644 --- a/sys/arch/vax/mscp/mscp_disk.c +++ b/sys/arch/vax/mscp/mscp_disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mscp_disk.c,v 1.5 1997/09/12 09:25:51 maja Exp $ */ +/* $OpenBSD: mscp_disk.c,v 1.6 1998/10/03 21:18:59 millert Exp $ */ /* $NetBSD: mscp_disk.c,v 1.13 1997/06/24 01:12:40 thorpej Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. @@ -240,7 +240,7 @@ ra_putonline(ra) printf("%s", ra->ra_dev.dv_xname); if ((msg = readdisklabel(raminor(ra->ra_dev.dv_unit, 0), - rastrategy, dl, NULL)) != NULL) + rastrategy, dl, NULL, 0)) != NULL) printf(": %s", msg); else ra->ra_havelabel = 1; diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c index 8b213eeca28..f9f998e24c4 100644 --- a/sys/arch/vax/vax/disksubr.c +++ b/sys/arch/vax/vax/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.9 1997/09/12 09:30:54 maja Exp $ */ +/* $OpenBSD: disksubr.c,v 1.10 1998/10/03 21:18:56 millert Exp $ */ /* $NetBSD: disksubr.c,v 1.13 1997/07/06 22:38:26 ragge Exp $ */ /* @@ -118,11 +118,12 @@ bad: * 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; { register struct buf *bp; struct disklabel *dlp; @@ -135,6 +136,10 @@ readdisklabel(dev, strat, lp, osdep) lp->d_partitions[2].p_offset = 0; } + /* don't read the on-disk label if we are in spoofed-only mode */ + if (spoofonly) + return (NULL); + bp = geteblk((int)lp->d_secsize); bp->b_dev = dev; bp->b_blkno = LABELSECTOR; |