diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2008-03-20 00:59:38 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2008-03-20 00:59:38 +0000 |
commit | bd1c954b3cf550ff46f0c89f0b7b2b2789197e75 (patch) | |
tree | 6fa3516048b27bd5e1b441e33afd6ae10f62d8d3 /sys/arch | |
parent | f9ef425eff7652492de5b3669bde6b2896572af7 (diff) |
Bring isa/fd.c into line with sparc/sparc64 fd code and prepare all
for the addition of missing disklabel related ioctl's.
ok deraadt@
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/sparc/dev/fd.c | 15 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/fd.c | 15 |
2 files changed, 12 insertions, 18 deletions
diff --git a/sys/arch/sparc/dev/fd.c b/sys/arch/sparc/dev/fd.c index 0e077bb12e1..7fab915b034 100644 --- a/sys/arch/sparc/dev/fd.c +++ b/sys/arch/sparc/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.56 2007/11/27 16:22:13 martynas Exp $ */ +/* $OpenBSD: fd.c,v 1.57 2008/03/20 00:59:37 krw Exp $ */ /* $NetBSD: fd.c,v 1.51 1997/05/24 20:16:19 pk Exp $ */ /*- @@ -244,7 +244,7 @@ struct cfdriver fd_cd = { NULL, "fd", DV_DISK }; -void fdgetdisklabel(dev_t); +void fdgetdisklabel(dev_t, struct fd_softc *, struct disklabel *, int); int fd_get_parms(struct fd_softc *); void fdstrategy(struct buf *); void fdstart(struct fd_softc *); @@ -984,7 +984,7 @@ fdopen(dev, flags, fmt, p) * Only update the disklabel if we're not open anywhere else. */ if (fd->sc_dk.dk_openmask == 0) - fdgetdisklabel(dev); + fdgetdisklabel(dev, fd, fd->sc_dk.dk_label, 0); pmask = (1 << FDPART(dev)); @@ -1943,12 +1943,9 @@ fdformat(dev, finfo, p) } void -fdgetdisklabel(dev) - dev_t dev; +fdgetdisklabel(dev_t dev, struct fd_softc *fd, struct disklabel *lp, + int spoofonly) { - int unit = FDUNIT(dev); - struct fd_softc *fd = fd_cd.cd_devs[unit]; - struct disklabel *lp = fd->sc_dk.dk_label; char *errstring; bzero(lp, sizeof(struct disklabel)); @@ -1974,7 +1971,7 @@ fdgetdisklabel(dev) /* * Call the generic disklabel extraction routine. */ - errstring = readdisklabel(DISKLABELDEV(dev), fdstrategy, lp, 0); + errstring = readdisklabel(DISKLABELDEV(dev), fdstrategy, lp, spoofonly); if (errstring) { /*printf("%s: %s\n", fd->sc_dv.dv_xname, errstring);*/ } diff --git a/sys/arch/sparc64/dev/fd.c b/sys/arch/sparc64/dev/fd.c index fc23660c18d..35c8bdc024c 100644 --- a/sys/arch/sparc64/dev/fd.c +++ b/sys/arch/sparc64/dev/fd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fd.c,v 1.19 2007/10/01 16:11:19 krw Exp $ */ +/* $OpenBSD: fd.c,v 1.20 2008/03/20 00:59:37 krw Exp $ */ /* $NetBSD: fd.c,v 1.112 2003/08/07 16:29:35 agc Exp $ */ /*- @@ -290,7 +290,7 @@ struct cfdriver fd_cd = { NULL, "fd", DV_DISK }; -void fdgetdisklabel(dev_t); +void fdgetdisklabel(dev_t, struct fd_softc *, struct disklabel *, int); int fd_get_parms(struct fd_softc *); void fdstrategy(struct buf *); void fdstart(struct fd_softc *); @@ -991,7 +991,7 @@ fdopen(dev, flags, fmt, p) * Only update the disklabel if we're not open anywhere else. */ if (fd->sc_dk.dk_openmask == 0) - fdgetdisklabel(dev); + fdgetdisklabel(dev, fd, fd->sc_dk.dk_label, 0); pmask = (1 << DISKPART(dev)); @@ -1997,12 +1997,9 @@ fdformat(dev, finfo, p) } void -fdgetdisklabel(dev) - dev_t dev; +fdgetdisklabel(dev_t dev, struct fd_softc *fd, struct disklabel *lp, + int spoofonly) { - int unit = FDUNIT(dev); - struct fd_softc *fd = fd_cd.cd_devs[unit]; - struct disklabel *lp = fd->sc_dk.dk_label; char *errstring; bzero(lp, sizeof(struct disklabel)); @@ -2029,7 +2026,7 @@ fdgetdisklabel(dev) * Call the generic disklabel extraction routine. If there's * not a label there, fake it. */ - errstring = readdisklabel(DISKLABELDEV(dev), fdstrategy, lp, 0); + errstring = readdisklabel(DISKLABELDEV(dev), fdstrategy, lp, spoofonly); if (errstring) { /*printf("%s: %s\n", fd->sc_dv.dv_xname, errstring);*/ } |