Date: Sat, 31 Jan 2009 12:32:18 +0000 (UTC) From: Alexander Motin <mav@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r187952 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern Message-ID: <200901311232.n0VCWIM6024541@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mav Date: Sat Jan 31 12:32:18 2009 New Revision: 187952 URL: http://svn.freebsd.org/changeset/base/187952 Log: MFC rev. 187409 Teach m_copyback() to use trailing space of the last mbuf in chain. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/kern/uipc_mbuf.c Modified: stable/7/sys/kern/uipc_mbuf.c ============================================================================== --- stable/7/sys/kern/uipc_mbuf.c Sat Jan 31 12:29:12 2009 (r187951) +++ stable/7/sys/kern/uipc_mbuf.c Sat Jan 31 12:32:18 2009 (r187952) @@ -1267,6 +1267,10 @@ m_copyback(struct mbuf *m0, int off, int m = m->m_next; } while (len > 0) { + if (m->m_next == NULL && (len > m->m_len - off)) { + m->m_len += min(len - (m->m_len - off), + M_TRAILINGSPACE(m)); + } mlen = min (m->m_len - off, len); bcopy(cp, off + mtod(m, caddr_t), (u_int)mlen); cp += mlen;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901311232.n0VCWIM6024541>