summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-09-21 12:20:54 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-09-21 12:20:54 +0000
commit4c7e1d738e7f47cfca98e7c5c7e0e7c678e311ce (patch)
treea84cb6930b354e26bf566c2de1b7055b5151f2a0
parent29344842a383976cad92768fc81afe17ff8a5c9b (diff)
Add a real DIOCGPDINFO, allowing access to the physical information
about the device rather than the contents of whichever disklabel was read. Tweak whitespace in sd.c to make the code appearance consistant.
-rw-r--r--sys/scsi/cd.c8
-rw-r--r--sys/scsi/sd.c3
2 files changed, 8 insertions, 3 deletions
diff --git a/sys/scsi/cd.c b/sys/scsi/cd.c
index 759e0271e06..4794294541e 100644
--- a/sys/scsi/cd.c
+++ b/sys/scsi/cd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cd.c,v 1.193 2010/09/20 02:51:52 deraadt Exp $ */
+/* $OpenBSD: cd.c,v 1.194 2010/09/21 12:20:53 krw Exp $ */
/* $NetBSD: cd.c,v 1.100 1997/04/02 02:29:30 mycroft Exp $ */
/*
@@ -850,8 +850,12 @@ cdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
bcopy(lp, sc->sc_dk.dk_label, sizeof(*lp));
free(lp, M_TEMP);
break;
- case DIOCGDINFO:
+
case DIOCGPDINFO:
+ cdgetdisklabel(dev, sc, (struct disklabel *)addr, 1);
+ break;
+
+ case DIOCGDINFO:
*(struct disklabel *)addr = *(sc->sc_dk.dk_label);
break;
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 8e78981de4b..92dce4f2203 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.215 2010/09/20 02:51:52 deraadt Exp $ */
+/* $OpenBSD: sd.c,v 1.216 2010/09/21 12:20:53 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -904,6 +904,7 @@ sdioctl(dev_t dev, u_long cmd, caddr_t addr, int flag, struct proc *p)
bcopy(lp, sc->sc_dk.dk_label, sizeof(*lp));
free(lp, M_TEMP);
goto exit;
+
case DIOCGPDINFO:
sdgetdisklabel(dev, sc, (struct disklabel *)addr, 1);
goto exit;