diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-12-23 01:06:36 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2008-12-23 01:06:36 +0000 |
commit | 8083bb86bd02150fececb5437e32e454c0a9cfd6 (patch) | |
tree | a207782bcca98e09b6290d71763ef0ba00ed7231 | |
parent | 094503812a9f56b04a48dec1c76dba85a2ed7c8f (diff) |
The splvm() protection is way outdated, only splnet is needed to protect
this pool (and the mbstat variables, and a few other things in certain
cases)
ok mikeb, tedu, and discussion with others...
-rw-r--r-- | sys/kern/uipc_mbuf.c | 14 | ||||
-rw-r--r-- | sys/sys/mbuf.h | 6 |
2 files changed, 10 insertions, 10 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 9c98edcd5b5..eed5cfd7c76 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.113 2008/12/22 18:35:52 claudio Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.114 2008/12/23 01:06:35 deraadt Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -164,7 +164,7 @@ m_reclaim(void *arg, int flags) { struct domain *dp; struct protosw *pr; - int s = splvm(); + int s = splnet(); for (dp = domains; dp; dp = dp->dom_next) for (pr = dp->dom_protosw; pr < dp->dom_protoswNPROTOSW; pr++) @@ -183,7 +183,7 @@ m_get(int nowait, int type) struct mbuf *m; int s; - s = splvm(); + s = splnet(); m = pool_get(&mbpool, nowait == M_WAIT ? PR_WAITOK : 0); if (m) mbstat.m_mtypes[type]++; @@ -208,7 +208,7 @@ m_gethdr(int nowait, int type) struct mbuf *m; int s; - s = splvm(); + s = splnet(); m = pool_get(&mbpool, nowait == M_WAIT ? PR_WAITOK : 0); if (m) mbstat.m_mtypes[type]++; @@ -389,7 +389,7 @@ m_clget(struct mbuf *m, int how, struct ifnet *ifp, u_int pktlen) if (ifp != NULL && m_cldrop(ifp, pi)) return; - s = splvm(); + s = splnet(); m->m_ext.ext_buf = pool_get(mclp, how == M_WAIT ? PR_WAITOK : 0); splx(s); if (m->m_ext.ext_buf != NULL) { @@ -414,7 +414,7 @@ m_free(struct mbuf *m) struct mbuf *n; int s; - s = splvm(); + s = splnet(); mbstat.m_mtypes[m->m_type]--; if (m->m_flags & M_PKTHDR) m_tag_delete_chain(m); @@ -496,7 +496,7 @@ m_defrag(struct mbuf *m, int how) m->m_next = NULL; if (m->m_flags & M_EXT) { - int s = splvm(); + int s = splnet(); m_extfree(m); splx(s); } diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index fc15c7d0813..26957adabc3 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mbuf.h,v 1.119 2008/12/11 16:45:44 deraadt Exp $ */ +/* $OpenBSD: mbuf.h,v 1.120 2008/12/23 01:06:33 deraadt Exp $ */ /* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */ /* @@ -211,7 +211,7 @@ struct mbuf { /* * Macros for tracking external storage associated with an mbuf. * - * Note: add and delete reference must be called at splvm(). + * Note: add and delete reference must be called at splnet(). */ #ifdef DEBUG #define MCLREFDEBUGN(m, file, line) do { \ @@ -230,7 +230,7 @@ struct mbuf { #define MCLISREFERENCED(m) ((m)->m_ext.ext_nextref != (m)) #define MCLADDREFERENCE(o, n) do { \ - int ms = splvm(); \ + int ms = splnet(); \ (n)->m_flags |= ((o)->m_flags & (M_EXT|M_CLUSTER)); \ (n)->m_ext.ext_nextref = (o)->m_ext.ext_nextref; \ (n)->m_ext.ext_prevref = (o); \ |