summaryrefslogtreecommitdiff
path: root/sys/dev/vnd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2009-08-13 15:23:14 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2009-08-13 15:23:14 +0000
commitcf6459c8f783ece5445be14e8e2e7201f7cd6632 (patch)
treea5a86e9615b432c0d3ef13f965013ddf06ea6bff /sys/dev/vnd.c
parent46faf138ca97f0462a1c22674098875302fe10d0 (diff)
Replace the error strings that were being passed around with much simpler
errnos. Note that the error strings are being ignored, since we long ago decided to not spam the console, and there is no other nice way to use the errors (without changing the ioctls to pass it back) The errno is now useful, since we can pass b_error from failing IO up, and the drive can decide how to use that ok miod
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r--sys/dev/vnd.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 43c78122563..14e94094cf5 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.93 2009/06/17 01:30:30 thib Exp $ */
+/* $OpenBSD: vnd.c,v 1.94 2009/08/13 15:23:11 deraadt Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -163,7 +163,7 @@ void vndstart(struct vnd_softc *);
int vndsetcred(struct vnd_softc *, struct ucred *);
void vndiodone(struct buf *);
void vndshutdown(void);
-void vndgetdisklabel(dev_t, struct vnd_softc *, struct disklabel *, int);
+int vndgetdisklabel(dev_t, struct vnd_softc *, struct disklabel *, int);
void vndencrypt(struct vnd_softc *, caddr_t, size_t, daddr64_t, int);
size_t vndbdevsize(struct vnode *, struct proc *);
@@ -300,12 +300,10 @@ bad:
/*
* Load the label information on the named device
*/
-void
+int
vndgetdisklabel(dev_t dev, struct vnd_softc *sc, struct disklabel *lp,
int spoofonly)
{
- char *errstring = NULL;
-
bzero(lp, sizeof(struct disklabel));
lp->d_secsize = sc->sc_secsize;
@@ -328,12 +326,7 @@ vndgetdisklabel(dev_t dev, struct vnd_softc *sc, struct disklabel *lp,
lp->d_checksum = dkcksum(lp);
/* Call the generic disklabel extraction routine */
- errstring = readdisklabel(VNDLABELDEV(dev), vndstrategy, lp, spoofonly);
- if (errstring) {
- DNPRINTF(VDB_IO, "%s: %s\n", sc->sc_dev.dv_xname,
- errstring);
- return;
- }
+ return readdisklabel(VNDLABELDEV(dev), vndstrategy, lp, spoofonly);
}
int