summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Rizzo <luigi@FreeBSD.org>2001-10-26 06:44:51 +0000
committerLuigi Rizzo <luigi@FreeBSD.org>2001-10-26 06:44:51 +0000
commitabb690fa10e38768083bf9a1448330850c1bc836 (patch)
tree538869d77324be0bd3c1fed39b7c2468527b6858
parentd98b0cb5606a20b3a728f744899e53ef04bd66db (diff)
Notes
-rw-r--r--sys/sys/mbuf.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 8c7c620bfe9b..afa8c72d8a3d 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -473,8 +473,11 @@ union mcluster {
/*
* Check if we can write to an mbuf.
*/
+#define M_EXT_WRITABLE(m) \
+ ((m)->m_ext.ext_free == NULL && mclrefcnt[mtocl((m)->m_ext.ext_buf)] == 1)
+
#define M_WRITABLE(m) (!((m)->m_flags & M_EXT) || \
- ((m)->m_ext.ext_free == NULL && mclrefcnt[mtocl((m)->m_ext.ext_buf)] == 1))
+ M_EXT_WRITABLE(m) )
/*
* Compute the amount of space available
@@ -482,7 +485,7 @@ union mcluster {
*/
#define M_LEADINGSPACE(m) \
((m)->m_flags & M_EXT ? \
- /* (m)->m_data - (m)->m_ext.ext_buf */ 0 : \
+ (M_EXT_WRITABLE(m) ? (m)->m_data - (m)->m_ext.ext_buf : 0): \
(m)->m_flags & M_PKTHDR ? (m)->m_data - (m)->m_pktdat : \
(m)->m_data - (m)->m_dat)