summaryrefslogtreecommitdiff
path: root/sys/dev/scsipi/cd.c
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2014-12-31 19:52:04 +0000
committerchristos <christos@NetBSD.org>2014-12-31 19:52:04 +0000
commit4a331aac448bc6ebd006fa2ea80af68f57c666eb (patch)
treea61e69370e02aa55f74db2134eb4c32a0ce55868 /sys/dev/scsipi/cd.c
parent7e0dbe4aff861a57f08f15f13b40808d8bd26a6f (diff)
make more drivers use disk_ioctl, and add a dev parameter to it so that
we can merge the "easy" disklabel ioctls to it. Ultimately all this will go do dk_ioctl once all the drivers have been converted.
Diffstat (limited to 'sys/dev/scsipi/cd.c')
-rw-r--r--sys/dev/scsipi/cd.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/sys/dev/scsipi/cd.c b/sys/dev/scsipi/cd.c
index 00eb59176f4..a82b7d92b70 100644
--- a/sys/dev/scsipi/cd.c
+++ b/sys/dev/scsipi/cd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cd.c,v 1.326 2014/12/31 19:37:35 mlelstv Exp $ */
+/* $NetBSD: cd.c,v 1.327 2014/12/31 19:52:06 christos Exp $ */
/*-
* Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@@ -50,7 +50,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.326 2014/12/31 19:37:35 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.327 2014/12/31 19:52:06 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1321,35 +1321,12 @@ cdioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l)
}
}
- error = disk_ioctl(&cd->sc_dk, cmd, addr, flag, l);
+ error = disk_ioctl(&cd->sc_dk, dev, cmd, addr, flag, l);
if (error != EPASSTHROUGH)
return (error);
error = 0;
switch (cmd) {
- case DIOCGDINFO:
- *(struct disklabel *)addr = *(cd->sc_dk.dk_label);
- return (0);
-#ifdef __HAVE_OLD_DISKLABEL
- case ODIOCGDINFO:
- newlabel = malloc(sizeof (*newlabel), M_TEMP, M_WAITOK);
- if (newlabel == NULL)
- return (EIO);
- memcpy(newlabel, cd->sc_dk.dk_label, sizeof (*newlabel));
- if (newlabel->d_npartitions > OLDMAXPARTITIONS)
- error = ENOTTY;
- else
- memcpy(addr, newlabel, sizeof (struct olddisklabel));
- free(newlabel, M_TEMP);
- return error;
-#endif
-
- case DIOCGPART:
- ((struct partinfo *)addr)->disklab = cd->sc_dk.dk_label;
- ((struct partinfo *)addr)->part =
- &cd->sc_dk.dk_label->d_partitions[part];
- return (0);
-
case DIOCWDINFO:
case DIOCSDINFO:
#ifdef __HAVE_OLD_DISKLABEL