aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/uipc_mbuf.c
diff options
context:
space:
mode:
authorAndre Oppermann <andre@FreeBSD.org>2013-08-24 13:15:42 +0000
committerAndre Oppermann <andre@FreeBSD.org>2013-08-24 13:15:42 +0000
commit894734cbd6b48588ea83c3e273fd226534f361ce (patch)
treee03c662cce205e4663aa5f84ea52766f0d649838 /sys/kern/uipc_mbuf.c
parentafb295cc9a7dea865455a30cd69936f6b95cfaf4 (diff)
downloadsrc-894734cbd6b48588ea83c3e273fd226534f361ce.tar.gz
src-894734cbd6b48588ea83c3e273fd226534f361ce.zip
dd a 24 bits wide ext_flags field to m_ext by reducing ext_type
to 8 bits. ext_type is an enumerator and the number of types we have is a mere dozen. A couple of ext_types are renumbered to fit within 8 bits. EXT_VENDOR[1-4] and EXT_EXP[1-4] types for vendor-internal and experimental local mapping. The ext_flags field is currently unused but has a couple of flags already defined for future use. Again vendor and experimental flags are provided for local mapping. EXT_FLAG_BITS is provided for the printf(9) %b identifier. Initialize and copy ext_flags in the relevant mbuf functions. Improve alignment and packing of struct m_ext on 32 and 64 archs by carefully sorting the fields.
Notes
Notes: svn path=/head/; revision=254780
Diffstat (limited to 'sys/kern/uipc_mbuf.c')
-rw-r--r--sys/kern/uipc_mbuf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 8395aacb86d7..f02e8cecbbd2 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -267,6 +267,7 @@ m_extadd(struct mbuf *mb, caddr_t buf, u_int size,
mb->m_ext.ext_arg1 = arg1;
mb->m_ext.ext_arg2 = arg2;
mb->m_ext.ext_type = type;
+ mb->m_ext.ext_flags = 0;
return (0);
}
@@ -342,6 +343,7 @@ mb_free_ext(struct mbuf *m)
m->m_ext.ref_cnt = NULL;
m->m_ext.ext_size = 0;
m->m_ext.ext_type = 0;
+ m->m_ext.ext_flags = 0;
m->m_flags &= ~M_EXT;
uma_zfree(zone_mbuf, m);
}
@@ -368,6 +370,7 @@ mb_dupcl(struct mbuf *n, struct mbuf *m)
n->m_ext.ext_size = m->m_ext.ext_size;
n->m_ext.ref_cnt = m->m_ext.ref_cnt;
n->m_ext.ext_type = m->m_ext.ext_type;
+ n->m_ext.ext_flags = m->m_ext.ext_flags;
n->m_flags |= M_EXT;
n->m_flags |= m->m_flags & M_RDONLY;
}