summaryrefslogtreecommitdiffstats
path: root/sys/sys/mbuf.h
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2015-04-24 21:38:18 +0000
committerngie <ngie@FreeBSD.org>2015-04-24 21:38:18 +0000
commitf4535e80c9bbf9c3ea567e18c7817e621c2694ff (patch)
tree4231f542b9659588dd25d2df2025745ff281aebf /sys/sys/mbuf.h
parent8518c5cf964dfabc1ae66a8021b1bf1d89e11253 (diff)
downloadFreeBSD-src-f4535e80c9bbf9c3ea567e18c7817e621c2694ff.zip
FreeBSD-src-f4535e80c9bbf9c3ea567e18c7817e621c2694ff.tar.gz
Backport MHSIZE/MPKTHSIZE equivalents from head
These macros are equivalent to the ones on head, except they are only exposed when _KERNEL is defined, i.e. to kernel code, whereas the code on head is exposed to userland as well This is for improved forwards compatibility with mbuf(9) macros in head@r277203+, and is required for a clean MFC of r279393 This is a direct commit to stable/10 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D2126 Reviewed by: glebius, rwatson Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/sys/mbuf.h')
-rw-r--r--sys/sys/mbuf.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 38644bf..63f7461 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -206,6 +206,16 @@ struct mbuf {
#define m_pktdat M_dat.MH.MH_dat.MH_databuf
#define m_dat M_dat.M_databuf
+/*
+ * NOTE: forwards compatibility definitions for mbuf(9)
+ *
+ * These aren't 1:1 with the macros in r277203; in particular they're exposed
+ * to both userland and kernel, whereas this is exposed to just _KERNEL -- to
+ * avoid disruption with existing KBI/KPIs
+ */
+#define MHSIZE offsetof(struct mbuf, m_dat)
+#define MPKTHSIZE offsetof(struct mbuf, m_pktdat)
+
/*
* mbuf flags of global significance and layer crossing.
* Those of only protocol/layer specific significance are to be mapped
OpenPOWER on IntegriCloud