Source-Changes-HG archive

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

[src/trunk]: src/sys/net Get rid of unnecessary splnet for pool_{get, put}



details:   https://anonhg.NetBSD.org/src/rev/5fe0d3d1342c
branches:  trunk
changeset: 329964:5fe0d3d1342c
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Sun Jun 15 16:10:46 2014 +0000

description:
Get rid of unnecessary splnet for pool_{get,put}

A mutex prevents interrupts in the functions now.

diffstat:

 sys/net/if_bridge.c |  10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diffs (47 lines):

diff -r 17bd9e4a15a5 -r 5fe0d3d1342c sys/net/if_bridge.c
--- a/sys/net/if_bridge.c       Sun Jun 15 14:36:57 2014 +0000
+++ b/sys/net/if_bridge.c       Sun Jun 15 16:10:46 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bridge.c,v 1.77 2013/06/29 21:06:58 rmind Exp $     */
+/*     $NetBSD: if_bridge.c,v 1.78 2014/06/15 16:10:46 ozaki-r Exp $   */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -80,7 +80,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.77 2013/06/29 21:06:58 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bridge.c,v 1.78 2014/06/15 16:10:46 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_bridge_ipf.h"
@@ -1647,7 +1647,7 @@
     struct ifnet *dst_if, int setflags, uint8_t flags)
 {
        struct bridge_rtnode *brt;
-       int error, s;
+       int error;
 
        /*
         * A route for this destination might already exist.  If so,
@@ -1662,9 +1662,7 @@
                 * initialize the expiration time and Ethernet
                 * address.
                 */
-               s = splnet();
                brt = pool_get(&bridge_rtnode_pool, PR_NOWAIT);
-               splx(s);
                if (brt == NULL)
                        return (ENOMEM);
 
@@ -1674,9 +1672,7 @@
                memcpy(brt->brt_addr, dst, ETHER_ADDR_LEN);
 
                if ((error = bridge_rtnode_insert(sc, brt)) != 0) {
-                       s = splnet();
                        pool_put(&bridge_rtnode_pool, brt);
-                       splx(s);
                        return (error);
                }
        }



Home | Main Index | Thread Index | Old Index