diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-07-20 09:59:20 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2007-07-20 09:59:20 +0000 |
commit | 08e4b840634d753e4bfafb21ee38871401d61680 (patch) | |
tree | d55e4c4159830f3a047e9a48cc7fc2f1b5f41268 /sys/kern/uipc_mbuf.c | |
parent | f4225c095ae4a89bad3d36386cc6e596fbd26a10 (diff) |
Remove the MFREE() macro and replace it with a call to m_free().
Also remove the _MEXTREMOVE macro which was only used by MFREE.
This time with the uipc_mbuf.c change that I missed last time.
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index a20212d2ea3..5bec7746a28 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.84 2007/06/02 09:45:32 art Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.85 2007/07/20 09:59:19 claudio Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -239,8 +239,29 @@ struct mbuf * m_free(struct mbuf *m) { struct mbuf *n; + int s; + + s = splvm(); + mbstat.m_mtypes[m->m_type]--; + if (m->m_flags & M_PKTHDR) + m_tag_delete_chain(m); + if (m->m_flags & M_EXT) { + if (MCLISREFERENCED(m)) + _MCLDEREFERENCE(m); + else if (m->m_flags & M_CLUSTER) + pool_put(&mclpool, m->m_ext.ext_buf); + else if (m->m_ext.ext_free) + (*(m->m_ext.ext_free))(m->m_ext.ext_buf, + m->m_ext.ext_size, m->m_ext.ext_arg); + else + free(m->m_ext.ext_buf,m->m_ext.ext_type); + m->m_flags &= ~(M_CLUSTER|M_EXT); + m->m_ext.ext_size = 0; + } + n = m->m_next; + pool_put(&mbpool, m); + splx(s); - MFREE(m, n); return (n); } |