summaryrefslogtreecommitdiffstats
path: root/sys/kern/uipc_mbuf.c
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2013-08-24 13:15:42 +0000
committerandre <andre@FreeBSD.org>2013-08-24 13:15:42 +0000
commit817be10f1c2c92e0673cb372ae147817a30f922b (patch)
treee03c662cce205e4663aa5f84ea52766f0d649838 /sys/kern/uipc_mbuf.c
parentb9a332b6b2d49d14c1362a93fe3d917544bef915 (diff)
downloadFreeBSD-src-817be10f1c2c92e0673cb372ae147817a30f922b.zip
FreeBSD-src-817be10f1c2c92e0673cb372ae147817a30f922b.tar.gz
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.
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 8395aac..f02e8ce 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;
}
OpenPOWER on IntegriCloud