Deleted Added
full compact
uipc_mbuf.c (145883) uipc_mbuf.c (148552)
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 145883 2005-05-04 18:55:03Z emax $");
33__FBSDID("$FreeBSD: head/sys/kern/uipc_mbuf.c 148552 2005-07-30 01:32:16Z sam $");
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>

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

1377 return (m_final);
1378nospace:
1379 if (m_new)
1380 m_free(m_new);
1381 if (m_final)
1382 m_freem(m_final);
1383 return (NULL);
1384}
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>

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

1377 return (m_final);
1378nospace:
1379 if (m_new)
1380 m_free(m_new);
1381 if (m_final)
1382 m_freem(m_final);
1383 return (NULL);
1384}
1385
1386/*
1387 * Set the m_data pointer of a newly-allocated mbuf
1388 * to place an object of the specified size at the
1389 * end of the mbuf, longword aligned.
1390 */
1391void
1392m_align(struct mbuf *m, int len)
1393{
1394 int adjust;
1395
1396 if (m->m_flags & M_EXT)
1397 adjust = m->m_ext.ext_size - len;
1398 else if (m->m_flags & M_PKTHDR)
1399 adjust = MHLEN - len;
1400 else
1401 adjust = MLEN - len;
1402 m->m_data += adjust &~ (sizeof(long)-1);
1403}