Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/dkwedge pass also DIOCGCACHE to underlying device, s...



details:   https://anonhg.NetBSD.org/src/rev/77485eab4f1d
branches:  trunk
changeset: 822063:77485eab4f1d
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Mon Feb 27 21:27:07 2017 +0000

description:
pass also DIOCGCACHE to underlying device, so that upper layers would be able
to get the device cache properties without knowing the topology; while here also
pass down DIOCGSTRATEGY for neater dkctl(8) output

diffstat:

 sys/dev/dkwedge/dk.c |  16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diffs (38 lines):

diff -r b96cee257e25 -r 77485eab4f1d sys/dev/dkwedge/dk.c
--- a/sys/dev/dkwedge/dk.c      Mon Feb 27 21:25:45 2017 +0000
+++ b/sys/dev/dkwedge/dk.c      Mon Feb 27 21:27:07 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dk.c,v 1.94 2017/01/19 00:44:40 maya Exp $     */
+/*     $NetBSD: dk.c,v 1.95 2017/02/27 21:27:07 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 2004, 2005, 2006, 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.94 2017/01/19 00:44:40 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dk.c,v 1.95 2017/02/27 21:27:07 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_dkwedge.h"
@@ -1478,16 +1478,10 @@
        error = 0;
        
        switch (cmd) {
+       case DIOCGSTRATEGY:
+       case DIOCGCACHE:
        case DIOCCACHESYNC:
-               /*
-                * XXX Do we really need to care about having a writable
-                * file descriptor here?
-                */
-               if ((flag & FWRITE) == 0)
-                       error = EBADF;
-               else
-                       error = VOP_IOCTL(sc->sc_parent->dk_rawvp,
-                                         cmd, data, flag,
+               error = VOP_IOCTL(sc->sc_parent->dk_rawvp, cmd, data, flag,
                                          l != NULL ? l->l_cred : NOCRED);
                break;
        case DIOCGWEDGEINFO:



Home | Main Index | Thread Index | Old Index