Deleted Added
full compact
uipc_mbuf.c (178700) uipc_mbuf.c (182777)
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 178700 2008-04-30 20:00:30Z julian $");
33__FBSDID("$FreeBSD: head/sys/kern/uipc_mbuf.c 182777 2008-09-05 04:05:31Z thompsa $");
34
35#include "opt_mac.h"
36#include "opt_param.h"
37#include "opt_mbuf_stress_test.h"
38#include "opt_mbuf_profiling.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>

--- 1685 unchanged lines hidden (view full) ---

1727 */
1728 if (len > 0)
1729 total = min(uio->uio_resid, len);
1730 else
1731 total = uio->uio_resid;
1732
1733 /*
1734 * The smallest unit returned by m_getm2() is a single mbuf
34
35#include "opt_mac.h"
36#include "opt_param.h"
37#include "opt_mbuf_stress_test.h"
38#include "opt_mbuf_profiling.h"
39
40#include <sys/param.h>
41#include <sys/systm.h>

--- 1685 unchanged lines hidden (view full) ---

1727 */
1728 if (len > 0)
1729 total = min(uio->uio_resid, len);
1730 else
1731 total = uio->uio_resid;
1732
1733 /*
1734 * The smallest unit returned by m_getm2() is a single mbuf
1735 * with pkthdr. We can't align past it. Align align itself.
1735 * with pkthdr. We can't align past it.
1736 */
1736 */
1737 if (align)
1738 align &= ~(sizeof(long) - 1);
1739 if (align >= MHLEN)
1740 return (NULL);
1741
1742 /*
1743 * Give us the full allocation or nothing.
1744 * If len is zero return the smallest empty mbuf.
1745 */
1746 m = m_getm2(NULL, max(total + align, 1), how, MT_DATA, flags);

--- 346 unchanged lines hidden ---
1737 if (align >= MHLEN)
1738 return (NULL);
1739
1740 /*
1741 * Give us the full allocation or nothing.
1742 * If len is zero return the smallest empty mbuf.
1743 */
1744 m = m_getm2(NULL, max(total + align, 1), how, MT_DATA, flags);

--- 346 unchanged lines hidden ---