summaryrefslogtreecommitdiff
path: root/sys/dev/ccd.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2009-06-04 05:57:28 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2009-06-04 05:57:28 +0000
commit773d991fb0d90b5b8d25d378d7043919becab01e (patch)
tree3ab94aad4e2edc8ecfaeecbb098922375318a39f /sys/dev/ccd.c
parent32d374af3a6d3edf3bcc269559ecb942cb36befb (diff)
Add DIOCRLDINFO to those drivers previously deprived.
Noticed by & ok deraadt@
Diffstat (limited to 'sys/dev/ccd.c')
-rw-r--r--sys/dev/ccd.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/ccd.c b/sys/dev/ccd.c
index 42609c64f8f..18169e5efd2 100644
--- a/sys/dev/ccd.c
+++ b/sys/dev/ccd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccd.c,v 1.85 2008/07/01 04:15:59 ray Exp $ */
+/* $OpenBSD: ccd.c,v 1.86 2009/06/04 05:57:27 krw Exp $ */
/* $NetBSD: ccd.c,v 1.33 1996/05/05 04:21:14 thorpej Exp $ */
/*-
@@ -1012,6 +1012,7 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
int unit = DISKUNIT(dev);
int i, j, lookedup = 0, error = 0;
int part, pmask, s;
+ struct disklabel *lp;
struct ccd_softc *cs;
struct ccd_ioctl *ccio = (struct ccd_ioctl *)data;
struct ccddevice ccd;
@@ -1191,6 +1192,18 @@ ccdioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p)
splx(s);
break;
+ case DIOCRLDINFO:
+ if ((error = ccdlock(cs)) != 0)
+ return (error);
+
+ lp = malloc(sizeof(*lp), M_TEMP, M_WAITOK);
+ ccdgetdisklabel(dev, cs, lp, 0);
+ *(cs->sc_dkdev.dk_label) = *lp;
+ free(lp, M_TEMP);
+
+ ccdunlock(cs);
+ break;
+
case DIOCGPDINFO:
if ((error = ccdlock(cs)) != 0)
return (error);