summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_mbuf.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2013-08-21 18:12:04 +0000
committerandre <andre@FreeBSD.org>2013-08-21 18:12:04 +0000
commitd8dc6ade5b16b922f401f6bde3d6ae887c5f52ea (patch)
tree5a989555bf7cef8f0f5f4c415f9ed2d97fc34ee7 /sys/kern/uipc_mbuf.c
parent58d5d31b369ffa07e7a858a1734306f5fda8a553 (diff)
downloadFreeBSD-src-d8dc6ade5b16b922f401f6bde3d6ae887c5f52ea.zip
FreeBSD-src-d8dc6ade5b16b922f401f6bde3d6ae887c5f52ea.tar.gz
Revert r254520 and resurrect the M_NOFREE mbuf flag and functionality.
Requested by: np, grehan
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r--sys/kern/uipc_mbuf.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index c67c9da..8395aac 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -278,10 +278,16 @@ m_extadd(struct mbuf *mb, caddr_t buf, u_int size,
void
mb_free_ext(struct mbuf *m)
{
+ int skipmbuf;
KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__));
KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__));
+ /*
+ * check if the header is embedded in the cluster
+ */
+ skipmbuf = (m->m_flags & M_NOFREE);
+
/* Free attached storage if this mbuf is the only reference to it. */
if (*(m->m_ext.ref_cnt) == 1 ||
atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 1) {
@@ -322,6 +328,8 @@ mb_free_ext(struct mbuf *m)
("%s: unknown ext_type", __func__));
}
}
+ if (skipmbuf)
+ return;
/*
* Free this mbuf back to the mbuf zone with all m_ext
@@ -386,7 +394,7 @@ m_demote(struct mbuf *m0, int all)
m_freem(m->m_nextpkt);
m->m_nextpkt = NULL;
}
- m->m_flags = m->m_flags & (M_EXT|M_RDONLY);
+ m->m_flags = m->m_flags & (M_EXT|M_RDONLY|M_NOFREE);
}
}
OpenPOWER on IntegriCloud