diff options
author | julian <julian@FreeBSD.org> | 1996-08-19 03:32:10 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1996-08-19 03:32:10 +0000 |
commit | 7017ff366e6e5f69dc6c791ad5341524a7686e6b (patch) | |
tree | 240fb1bcf8a31fbe4babb80ad7ed2636c272c8b7 /sys/kern | |
parent | df9def6f62c391d351282ba6b34a350f072cab99 (diff) | |
download | FreeBSD-src-7017ff366e6e5f69dc6c791ad5341524a7686e6b.zip FreeBSD-src-7017ff366e6e5f69dc6c791ad5341524a7686e6b.tar.gz |
fix handling of external objects referenced by mbufs
somehow this got broken between 4.3 tahoe and here, though I've been using
these fixes for over a year here..
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index 0784592..edb63d4 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 - * $Id: uipc_mbuf.c,v 1.22 1996/05/11 20:43:23 phk Exp $ + * $Id: uipc_mbuf.c,v 1.23 1996/05/12 07:48:47 phk Exp $ */ #include <sys/param.h> @@ -378,7 +378,11 @@ m_copym(m, off0, len, wait) n->m_len = min(len, m->m_len - off); if (m->m_flags & M_EXT) { n->m_data = m->m_data + off; - mclrefcnt[mtocl(m->m_ext.ext_buf)]++; + if(!m->m_ext.ext_ref) + mclrefcnt[mtocl(m->m_ext.ext_buf)]++; + else + (*(m->m_ext.ext_ref))(m->m_ext.ext_buf, + m->m_ext.ext_size); n->m_ext = m->m_ext; n->m_flags |= M_EXT; } else @@ -710,7 +714,11 @@ extpacket: if (m->m_flags & M_EXT) { n->m_flags |= M_EXT; n->m_ext = m->m_ext; - mclrefcnt[mtocl(m->m_ext.ext_buf)]++; + if(!m->m_ext.ext_ref) + mclrefcnt[mtocl(m->m_ext.ext_buf)]++; + else + (*(m->m_ext.ext_ref))(m->m_ext.ext_buf, + m->m_ext.ext_size); m->m_ext.ext_size = 0; /* For Accounting XXXXXX danger */ n->m_data = m->m_data + len; } else { |