summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2008-11-24 15:14:34 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2008-11-24 15:14:34 +0000
commit77af5441c4277f23aa9bb5ac0c514d09abeef6da (patch)
tree64974c440ff2466682da07ccaa585ee551e9a7bb /sys
parent258bc5d0e768bac6b7cdce1f567dbe0a847c599c (diff)
MCLADDREFERENCE() was the last user of MBUFLOCK() inline the code and remove
MBUFLOCK()
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/mbuf.h21
1 files changed, 4 insertions, 17 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index cc39eb96dea..777689fedbb 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.h,v 1.112 2008/11/24 15:09:39 claudio Exp $ */
+/* $OpenBSD: mbuf.h,v 1.113 2008/11/24 15:14:33 claudio Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
@@ -195,19 +195,6 @@ struct mbuf {
#define M_WAIT M_WAITOK
/*
- * mbuf utility macros:
- *
- * MBUFLOCK(code)
- * prevents a section of code from from being interrupted by network
- * drivers.
- */
-#define MBUFLOCK(code) do { \
- int ms = splvm(); \
- { code } \
- splx(ms); \
-} while (/* CONSTCOND */ 0)
-
-/*
* mbuf allocation/deallocation macros:
*
* MGET(struct mbuf *m, int how, int type)
@@ -242,12 +229,14 @@ struct mbuf {
#define MCLISREFERENCED(m) ((m)->m_ext.ext_nextref != (m))
-#define _MCLADDREFERENCE(o, n) do { \
+#define MCLADDREFERENCE(o, n) do { \
+ int ms = splvm(); \
(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); \
(o)->m_ext.ext_nextref = (n); \
(n)->m_ext.ext_nextref->m_ext.ext_prevref = (n); \
+ splx(ms); \
MCLREFDEBUGN((n), __FILE__, __LINE__); \
} while (/* CONSTCOND */ 0)
@@ -258,8 +247,6 @@ struct mbuf {
MCLREFDEBUGN((m), NULL, 0); \
} while (/* CONSTCOND */ 0)
-#define MCLADDREFERENCE(o, n) MBUFLOCK(_MCLADDREFERENCE((o), (n));)
-
/*
* Macros for mbuf external storage.
*