From owner-svn-src-head@FreeBSD.ORG Sun Jan 18 20:19:55 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C7DE10656F4; Sun, 18 Jan 2009 20:19:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BFD68FC1E; Sun, 18 Jan 2009 20:19:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0IKJt8W086223; Sun, 18 Jan 2009 20:19:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0IKJtIQ086222; Sun, 18 Jan 2009 20:19:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <200901182019.n0IKJtIQ086222@svn.freebsd.org> From: Alexander Motin Date: Sun, 18 Jan 2009 20:19:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187409 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jan 2009 20:19:56 -0000 Author: mav Date: Sun Jan 18 20:19:55 2009 New Revision: 187409 URL: http://svn.freebsd.org/changeset/base/187409 Log: Teach m_copyback() to use trailing space of the last mbuf in chain. Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun Jan 18 19:56:13 2009 (r187408) +++ head/sys/kern/uipc_mbuf.c Sun Jan 18 20:19:55 2009 (r187409) @@ -1271,6 +1271,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;