netgraph7: ng_base: spl* -> crit_*
authorNuno Antunes <nuno.antunes@gmail.com>
Sat, 26 May 2012 18:12:56 +0000 (19:12 +0100)
committerNuno Antunes <nuno.antunes@gmail.com>
Sat, 9 Jun 2012 12:35:07 +0000 (13:35 +0100)
sys/netgraph7/dragonfly.h
sys/netgraph7/netgraph/ng_base.c

index dd6f6dd..50574e7 100644 (file)
@@ -92,9 +92,6 @@ typedef void *                uma_fini;
 #define CTR6(ktr_line, ...)
 #define cpu_spinwait() cpu_pause()
 
-#define splnet()       0
-#define splx(v)
-
 #define CTLFLAG_RDTUN  CTLFLAG_RD
 
 #define SI_SUB_NETGRAPH        SI_SUB_DRIVERS
index fd76572..846b6fb 100644 (file)
@@ -2983,15 +2983,15 @@ int
 ng_mod_event(module_t mod, int event, void *data)
 {
        struct ng_type *const type = data;
-       int s, error = 0;
+       int error = 0;
 
        switch (event) {
        case MOD_LOAD:
 
                /* Register new netgraph node type */
-               s = splnet();
+               crit_enter();
                if ((error = ng_newtype(type)) != 0) {
-                       splx(s);
+                       crit_exit();
                        break;
                }
 
@@ -3003,23 +3003,23 @@ ng_mod_event(module_t mod, int event, void *data)
                                LIST_REMOVE(type, types);
                                mtx_unlock(&ng_typelist_mtx);
                        }
-               splx(s);
+               crit_exit();
                break;
 
        case MOD_UNLOAD:
-               s = splnet();
+               crit_enter();
                if (type->refs > 1) {           /* make sure no nodes exist! */
                        error = EBUSY;
                } else {
                        if (type->refs == 0) {
                                /* failed load, nothing to undo */
-                               splx(s);
+                               crit_exit();
                                break;
                        }
                        if (type->mod_event != NULL) {  /* check with type */
                                error = (*type->mod_event)(mod, event, data);
                                if (error != 0) {       /* type refuses.. */
-                                       splx(s);
+                                       crit_exit();
                                        break;
                                }
                        }
@@ -3027,7 +3027,7 @@ ng_mod_event(module_t mod, int event, void *data)
                        LIST_REMOVE(type, types);
                        mtx_unlock(&ng_typelist_mtx);
                }
-               splx(s);
+               crit_exit();
                break;
 
        default: