uipc_mbuf.c (165447) | uipc_mbuf.c (166171) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 30 */ 31 32#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 16 unchanged lines hidden (view full) --- 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * 29 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 30 */ 31 32#include <sys/cdefs.h> |
33__FBSDID("$FreeBSD: head/sys/kern/uipc_mbuf.c 165447 2006-12-21 19:58:04Z rrs $"); | 33__FBSDID("$FreeBSD: head/sys/kern/uipc_mbuf.c 166171 2007-01-22 14:50:28Z andre $"); |
34 35#include "opt_mac.h" 36#include "opt_param.h" 37#include "opt_mbuf_stress_test.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/kernel.h> --- 1596 unchanged lines hidden (view full) --- 1638 * The smallest unit returned by m_getm2() is a single mbuf 1639 * with pkthdr. We can't align past it. Align align itself. 1640 */ 1641 if (align) 1642 align &= ~(sizeof(long) - 1); 1643 if (align >= MHLEN) 1644 return (NULL); 1645 | 34 35#include "opt_mac.h" 36#include "opt_param.h" 37#include "opt_mbuf_stress_test.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/kernel.h> --- 1596 unchanged lines hidden (view full) --- 1638 * The smallest unit returned by m_getm2() is a single mbuf 1639 * with pkthdr. We can't align past it. Align align itself. 1640 */ 1641 if (align) 1642 align &= ~(sizeof(long) - 1); 1643 if (align >= MHLEN) 1644 return (NULL); 1645 |
1646 /* Give us all or nothing. */ 1647 m = m_getm2(NULL, total + align, how, MT_DATA, flags); | 1646 /* 1647 * Give us the full allocation or nothing. 1648 * If len is zero return the smallest empty mbuf. 1649 */ 1650 m = m_getm2(NULL, max(total + align, 1), how, MT_DATA, flags); |
1648 if (m == NULL) 1649 return (NULL); 1650 m->m_data += align; 1651 1652 /* Fill all mbufs with uio data and update header information. */ 1653 for (mb = m; mb != NULL; mb = mb->m_next) { 1654 length = min(M_TRAILINGSPACE(mb), total - progress); 1655 --- 187 unchanged lines hidden --- | 1651 if (m == NULL) 1652 return (NULL); 1653 m->m_data += align; 1654 1655 /* Fill all mbufs with uio data and update header information. */ 1656 for (mb = m; mb != NULL; mb = mb->m_next) { 1657 length = min(M_TRAILINGSPACE(mb), total - progress); 1658 --- 187 unchanged lines hidden --- |