summaryrefslogtreecommitdiff
path: root/sys/dev/vnd.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/vnd.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/vnd.c')
-rw-r--r--sys/dev/vnd.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 09bf4262e20..3abb2388b4a 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vnd.c,v 1.237 2014/12/31 17:06:48 christos Exp $ */
+/* $NetBSD: vnd.c,v 1.238 2014/12/31 19:52:05 christos Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2008 The NetBSD Foundation, Inc.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.237 2014/12/31 17:06:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.238 2014/12/31 19:52:05 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vnd.h"
@@ -1059,10 +1059,6 @@ vndioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
return ENXIO;
vio = (struct vnd_ioctl *)data;
- error = disk_ioctl(&vnd->sc_dkdev, cmd, data, flag, l);
- if (error != EPASSTHROUGH)
- return (error);
-
/* Must be open for writes for these commands... */
switch (cmd) {
case VNDIOCSET:
@@ -1107,6 +1103,11 @@ vndioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
return ENXIO;
}
+ error = disk_ioctl(&vnd->sc_dkdev, dev, cmd, data, flag, l);
+ if (error != EPASSTHROUGH)
+ return error;
+
+
switch (cmd) {
#ifdef VNDIOCSET50
case VNDIOCSET50:
@@ -1464,25 +1465,6 @@ unlock_and_exit:
break;
}
- case DIOCGDINFO:
- *(struct disklabel *)data = *(vnd->sc_dkdev.dk_label);
- break;
-
-#ifdef __HAVE_OLD_DISKLABEL
- case ODIOCGDINFO:
- newlabel = *(vnd->sc_dkdev.dk_label);
- if (newlabel.d_npartitions > OLDMAXPARTITIONS)
- return ENOTTY;
- memcpy(data, &newlabel, sizeof (struct olddisklabel));
- break;
-#endif
-
- case DIOCGPART:
- ((struct partinfo *)data)->disklab = vnd->sc_dkdev.dk_label;
- ((struct partinfo *)data)->part =
- &vnd->sc_dkdev.dk_label->d_partitions[DISKPART(dev)];
- break;
-
case DIOCWDINFO:
case DIOCSDINFO:
#ifdef __HAVE_OLD_DISKLABEL