diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-06-04 05:57:28 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2009-06-04 05:57:28 +0000 |
commit | 773d991fb0d90b5b8d25d378d7043919becab01e (patch) | |
tree | 3ab94aad4e2edc8ecfaeecbb098922375318a39f /sys/dev/vnd.c | |
parent | 32d374af3a6d3edf3bcc269559ecb942cb36befb (diff) |
Add DIOCRLDINFO to those drivers previously deprived.
Noticed by & ok deraadt@
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r-- | sys/dev/vnd.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index 1ac734d5233..8cbda77ef91 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vnd.c,v 1.91 2009/06/03 22:09:30 thib Exp $ */ +/* $OpenBSD: vnd.c,v 1.92 2009/06/04 05:57:27 krw Exp $ */ /* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */ /* @@ -749,6 +749,7 @@ int vndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) { int unit = vndunit(dev); + struct disklabel *lp; struct vnd_softc *vnd; struct vnd_ioctl *vio; struct vnd_user *vnu; @@ -945,6 +946,15 @@ vndioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p) break; + case DIOCRLDINFO: + if ((vnd->sc_flags & VNF_HAVELABEL) == 0) + return (ENOTTY); + lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK); + vndgetdisklabel(dev, vnd, lp, 0); + *(vnd->sc_dk.dk_label) = *lp; + free(lp, M_TEMP); + return (0); + case DIOCGPDINFO: if ((vnd->sc_flags & VNF_HAVELABEL) == 0) return (ENOTTY); |