Source-Changes-HG archive

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

[src/trunk]: src/sys Get rid of splnet for pool(9)



details:   https://anonhg.NetBSD.org/src/rev/59b45328aeb8
branches:  trunk
changeset: 821073:59b45328aeb8
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Jan 23 09:14:24 2017 +0000

description:
Get rid of splnet for pool(9)

We don't need it anymore.

diffstat:

 sys/netinet/in_pcb.c   |  8 ++------
 sys/netinet6/in6_pcb.c |  8 ++------
 2 files changed, 4 insertions(+), 12 deletions(-)

diffs (76 lines):

diff -r cb5f47ade442 -r 59b45328aeb8 sys/netinet/in_pcb.c
--- a/sys/netinet/in_pcb.c      Mon Jan 23 08:36:23 2017 +0000
+++ b/sys/netinet/in_pcb.c      Mon Jan 23 09:14:24 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in_pcb.c,v 1.173 2017/01/11 13:08:29 ozaki-r Exp $     */
+/*     $NetBSD: in_pcb.c,v 1.174 2017/01/23 09:14:24 ozaki-r Exp $     */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -93,7 +93,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.173 2017/01/11 13:08:29 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in_pcb.c,v 1.174 2017/01/23 09:14:24 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -192,9 +192,7 @@
        struct inpcb *inp;
        int s;
 
-       s = splnet();
        inp = pool_get(&inpcb_pool, PR_NOWAIT);
-       splx(s);
        if (inp == NULL)
                return (ENOBUFS);
        memset(inp, 0, sizeof(*inp));
@@ -208,9 +206,7 @@
        if (ipsec_enabled) {
                int error = ipsec_init_pcbpolicy(so, &inp->inp_sp);
                if (error != 0) {
-                       s = splnet();
                        pool_put(&inpcb_pool, inp);
-                       splx(s);
                        return error;
                }
        }
diff -r cb5f47ade442 -r 59b45328aeb8 sys/netinet6/in6_pcb.c
--- a/sys/netinet6/in6_pcb.c    Mon Jan 23 08:36:23 2017 +0000
+++ b/sys/netinet6/in6_pcb.c    Mon Jan 23 09:14:24 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_pcb.c,v 1.155 2016/12/13 08:29:03 ozaki-r Exp $    */
+/*     $NetBSD: in6_pcb.c,v 1.156 2017/01/23 09:14:24 ozaki-r Exp $    */
 /*     $KAME: in6_pcb.c,v 1.84 2001/02/08 18:02:08 itojun Exp $        */
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.155 2016/12/13 08:29:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_pcb.c,v 1.156 2017/01/23 09:14:24 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -158,9 +158,7 @@
        struct in6pcb *in6p;
        int s;
 
-       s = splnet();
        in6p = pool_get(&in6pcb_pool, PR_NOWAIT);
-       splx(s);
        if (in6p == NULL)
                return (ENOBUFS);
        memset((void *)in6p, 0, sizeof(*in6p));
@@ -175,9 +173,7 @@
        if (ipsec_enabled) {
                int error = ipsec_init_pcbpolicy(so, &in6p->in6p_sp);
                if (error != 0) {
-                       s = splnet();
                        pool_put(&in6pcb_pool, in6p);
-                       splx(s);
                        return error;
                }
        }



Home | Main Index | Thread Index | Old Index