Source-Changes-HG archive

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

[src/trunk]: src/sys/miscfs/specfs Revert rev 1.164. This will be redone dif...



details:   https://anonhg.NetBSD.org/src/rev/658031bfc27a
branches:  trunk
changeset: 347641:658031bfc27a
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Thu Sep 08 08:45:52 2016 +0000

description:
Revert rev 1.164.  This will be redone differently (using "dummy"
modules).

This implementation requires changes to a base kernel in order to
update the set of "special" modules, kinda defeating the purpose of
having modules in the first place.  The new method will use dummy
modules (with name tap and tun) which will depend on the real
modules with the if_ prefix.

Coming soon to a NetBSD near you.

diffstat:

 sys/miscfs/specfs/spec_vnops.c |  35 ++---------------------------------
 1 files changed, 2 insertions(+), 33 deletions(-)

diffs (77 lines):

diff -r 8ff32da4c693 -r 658031bfc27a sys/miscfs/specfs/spec_vnops.c
--- a/sys/miscfs/specfs/spec_vnops.c    Thu Sep 08 04:41:16 2016 +0000
+++ b/sys/miscfs/specfs/spec_vnops.c    Thu Sep 08 08:45:52 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spec_vnops.c,v 1.164 2016/09/08 00:07:48 pgoyette Exp $        */
+/*     $NetBSD: spec_vnops.c,v 1.165 2016/09/08 08:45:52 pgoyette Exp $        */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.164 2016/09/08 00:07:48 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spec_vnops.c,v 1.165 2016/09/08 08:45:52 pgoyette Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -482,16 +482,6 @@
 
 typedef int (*spec_ioctl_t)(dev_t, u_long, void *, int, struct lwp *);
 
-struct dev_to_mod {
-       const char *dev_name, *mod_name;
-};
-
-struct dev_to_mod dev_mod_table[] = {
-       { "tap", "if_tap" },
-       { "tun", "if_tun" },
-       { NULL, NULL }
-};
-       
 /*
  * Open a special file.
  */
@@ -515,7 +505,6 @@
        u_int gen;
        const char *name;
        struct partinfo pi;
-       struct dev_to_mod *conv;
        
        l = curlwp;
        vp = ap->a_vp;
@@ -582,16 +571,6 @@
                        /* Get device name from devsw_conv array */
                        if ((name = cdevsw_getname(major(dev))) == NULL)
                                break;
-
-                       /* Check exception table for alternate module name */
-                       conv = dev_mod_table;
-                       while (conv->dev_name != NULL) {
-                               if (strcmp(conv->dev_name, name) == 0) {
-                                       name = conv->mod_name;
-                                       break;
-                               }
-                               conv++;
-                       }
                        
                        /* Try to autoload device module */
                        (void) module_autoload(name, MODULE_CLASS_DRIVER);
@@ -644,16 +623,6 @@
 
                        VOP_UNLOCK(vp);
 
-                       /* Check exception table for alternate module name */
-                       conv = dev_mod_table;
-                       while (conv->dev_name != NULL) {
-                               if (strcmp(conv->dev_name, name) == 0) {
-                                       name = conv->mod_name;
-                                       break;
-                               }
-                               conv++;
-                       }
-
                         /* Try to autoload device module */
                        (void) module_autoload(name, MODULE_CLASS_DRIVER);
                        



Home | Main Index | Thread Index | Old Index