summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_mbuf.c
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2007-10-06 21:42:39 +0000
committerkmacy <kmacy@FreeBSD.org>2007-10-06 21:42:39 +0000
commitcaeef6111c8450d350a0926d31968121a5b5ae73 (patch)
tree418691345a5209afc71ef70182373d04f589cdde /sys/kern/kern_mbuf.c
parentc00108fd67397129aaed54bbec1d64b7b0cd4259 (diff)
downloadFreeBSD-src-caeef6111c8450d350a0926d31968121a5b5ae73.zip
FreeBSD-src-caeef6111c8450d350a0926d31968121a5b5ae73.tar.gz
This patch adds an M_NOFREE flag which allows one to mark an mbuf as
not being independently freeable. This allows one to embed an mbuf in the cluster itself. This confers the benefits of the packet zone on all cluster sizes. Embedded mbufs currently suffer from the same limitation that packet zone mbufs do in that one cannot disconnect them and pass them around independently of the cluster. It would likely be possible to eliminate this limitation in the future by adding a second reference for the mbuf itself. Approved by: re(gnn)
Diffstat (limited to 'sys/kern/kern_mbuf.c')
-rw-r--r--sys/kern/kern_mbuf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c
index a5e1348..9015e24 100644
--- a/sys/kern/kern_mbuf.c
+++ b/sys/kern/kern_mbuf.c
@@ -347,6 +347,7 @@ mb_dtor_mbuf(void *mem, int size, void *arg)
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, ("%s: M_NOFREE set", __func__));
#ifdef INVARIANTS
trash_dtor(mem, size, arg);
#endif
OpenPOWER on IntegriCloud