summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorprlw1 <prlw1@NetBSD.org>2014-03-22 16:08:51 +0000
committerprlw1 <prlw1@NetBSD.org>2014-03-22 16:08:51 +0000
commitd72a6fd6355b62e64caca1971a781fa728d533f2 (patch)
treebf0bb1cc62f16ba7c183b0ca2f5dd9f1f323d661 /sys/dev
parente48cda0c1e0c66ee58fa12e0b06e060431ee92b0 (diff)
DIOCGDISKINFO support for vnd
Reviewed by apb@ and christos@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/vnd.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index 7cf40aa4ab8..4b30ddbb784 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vnd.c,v 1.228 2014/03/16 05:20:26 dholland Exp $ */
+/* $NetBSD: vnd.c,v 1.229 2014/03/22 16:08:51 prlw1 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.228 2014/03/16 05:20:26 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.229 2014/03/22 16:08:51 prlw1 Exp $");
#if defined(_KERNEL_OPT)
#include "opt_vnd.h"
@@ -1059,6 +1059,10 @@ 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:
@@ -2022,6 +2026,12 @@ vnd_set_geometry(struct vnd_softc *vnd)
dg->dg_ntracks = vnd->sc_geom.vng_ntracks;
dg->dg_ncylinders = vnd->sc_geom.vng_ncylinders;
+#ifdef DEBUG
+ if (vnddebug & VDB_LABEL) {
+ printf("dg->dg_secperunit: %" PRId64 "\n", dg->dg_secperunit);
+ printf("dg->dg_ncylinders: %u\n", dg->dg_ncylinders);
+ }
+#endif
disk_set_info(vnd->sc_dev, &vnd->sc_dkdev, NULL);
}