PERFORCE change 126760 for review
Kip Macy
kmacy at FreeBSD.org
Sun Sep 23 21:54:09 PDT 2007
http://perforce.freebsd.org/chv.cgi?CH=126760
Change 126760 by kmacy at kmacy_home:ethng on 2007/09/24 04:54:01
- we should never make it as far as the dtor if the memory is allocated from
another zone, but a KASSERT that this isn't an embedded mbuf just in case
- initialize ref_cnt packet zone ctor
Affected files ...
.. //depot/projects/ethng/src/sys/kern/kern_mbuf.c#7 edit
Differences ...
==== //depot/projects/ethng/src/sys/kern/kern_mbuf.c#7 (text+ko) ====
@@ -355,6 +355,7 @@
if ((flags & MB_NOTAGS) == 0 && (m->m_flags & M_PKTHDR) != 0)
m_tag_delete_chain(m, NULL);
KASSERT((m->m_flags & M_EXT) == 0, ("%s: M_EXT set", __func__));
+ KASSERT((m->m_flags & M_NOFREE) == 0, ("freeing embedded mbuf"));
#ifdef INVARIANTS
trash_dtor(mem, size, arg);
#endif
@@ -534,7 +535,8 @@
m->m_len = 0;
m->m_flags = (flags | M_EXT);
m->m_type = type;
-
+ m->m_ext.ref_cnt = NULL; /* lazy refcnt */
+
if (flags & M_PKTHDR) {
m->m_pkthdr.rcvif = NULL;
m->m_pkthdr.len = 0;
More information about the p4-projects
mailing list