Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev DIOCGDISKINFO support for vnd



details:   https://anonhg.NetBSD.org/src/rev/149ed89f76d4
branches:  trunk
changeset: 794701:149ed89f76d4
user:      prlw1 <prlw1%NetBSD.org@localhost>
date:      Sat Mar 22 16:08:51 2014 +0000

description:
DIOCGDISKINFO support for vnd
Reviewed by apb@ and christos@

diffstat:

 sys/dev/vnd.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (42 lines):

diff -r 262d824ef9da -r 149ed89f76d4 sys/dev/vnd.c
--- a/sys/dev/vnd.c     Sat Mar 22 15:59:07 2014 +0000
+++ b/sys/dev/vnd.c     Sat Mar 22 16:08:51 2014 +0000
@@ -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 @@
                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 @@
        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);
 }
 



Home | Main Index | Thread Index | Old Index