Let M_LEADINGSPACE write into non-shared mbufs.

A similar thing has been in -stable for weeks and is completely safe.

This has very good performance implications as it saves some data
copying, and sometimes avoids triggering performance bugs in devices
(such as the "dc" and other Tulip clones) which do not like scattered
data.
This commit is contained in:
Luigi Rizzo 2001-12-14 17:31:58 +00:00
parent 1cb4661d56
commit 99adc698c1

View file

@ -360,7 +360,7 @@ struct mbstat {
*/
#define M_LEADINGSPACE(m) \
((m)->m_flags & M_EXT ? \
/* (m)->m_data - (m)->m_ext.ext_buf */ 0 : \
(M_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)