Remove unused m_free_fast(). The difference to m_free() is only

2 predictable branches nowadays.  However as a pre-condition the
caller had to ensure that the mbuf pkthdr did not have any mtags
attached to it, costing some potential branches again.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
andre 2013-08-24 21:09:57 +00:00
parent 351bab29d0
commit 6ad648e223
2 changed files with 1 additions and 14 deletions

View File

@ -447,7 +447,7 @@ mb_dtor_mbuf(void *mem, int size, void *arg)
m = (struct mbuf *)mem;
flags = (unsigned long)arg;
if ((flags & MB_NOTAGS) == 0 && (m->m_flags & M_PKTHDR) != 0)
if ((m->m_flags & M_PKTHDR) && !SLIST_EMPTY(&m->m_pkthdr.tags))
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, ("%s: M_NOFREE set", __func__));

View File

@ -453,8 +453,6 @@ struct mbuf {
#define MT_NOINIT 255 /* Not a type but a flag to allocate
a non-initialized mbuf */
#define MB_NOTAGS 0x1UL /* no tags attached to mbuf */
/*
* Compatibility with historic mbuf allocator.
*/
@ -636,17 +634,6 @@ m_getcl(int how, short type, int flags)
return (uma_zalloc_arg(zone_pack, &args, how));
}
static __inline void
m_free_fast(struct mbuf *m)
{
#ifdef INVARIANTS
if (m->m_flags & M_PKTHDR)
KASSERT(SLIST_EMPTY(&m->m_pkthdr.tags), ("doing fast free of mbuf with tags"));
#endif
uma_zfree_arg(zone_mbuf, m, (void *)MB_NOTAGS);
}
static __inline struct mbuf *
m_free(struct mbuf *m)
{