Deleted Added
full compact
kern_mbuf.c (141093) kern_mbuf.c (141668)
1/*-
2 * Copyright (c) 2004, 2005
3 * Bosko Milekic <bmilekic@FreeBSD.org>.
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

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004, 2005
3 * Bosko Milekic <bmilekic@FreeBSD.org>.
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

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/kern/kern_mbuf.c 141093 2005-02-01 03:17:52Z bmilekic $");
29__FBSDID("$FreeBSD: head/sys/kern/kern_mbuf.c 141668 2005-02-10 22:23:02Z bmilekic $");
30
31#include "opt_mac.h"
32#include "opt_param.h"
33
34#include <sys/param.h>
35#include <sys/mac.h>
36#include <sys/malloc.h>
37#include <sys/systm.h>

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

257 m = (struct mbuf *)arg;
258 m->m_ext.ext_buf = (caddr_t)mem;
259 m->m_data = m->m_ext.ext_buf;
260 m->m_flags |= M_EXT;
261 m->m_ext.ext_free = NULL;
262 m->m_ext.ext_args = NULL;
263 m->m_ext.ext_size = MCLBYTES;
264 m->m_ext.ext_type = EXT_CLUSTER;
30
31#include "opt_mac.h"
32#include "opt_param.h"
33
34#include <sys/param.h>
35#include <sys/mac.h>
36#include <sys/malloc.h>
37#include <sys/systm.h>

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

257 m = (struct mbuf *)arg;
258 m->m_ext.ext_buf = (caddr_t)mem;
259 m->m_data = m->m_ext.ext_buf;
260 m->m_flags |= M_EXT;
261 m->m_ext.ext_free = NULL;
262 m->m_ext.ext_args = NULL;
263 m->m_ext.ext_size = MCLBYTES;
264 m->m_ext.ext_type = EXT_CLUSTER;
265 m->m_ext.ref_cnt = (u_int *)uma_find_refcnt(zone_clust,
266 m->m_ext.ext_buf);
267 *(m->m_ext.ref_cnt) = 1;
265 m->m_ext.ref_cnt = NULL; /* Lazy counter assign. */
268 mbstat.m_mclusts += 1; /* XXX */
269 return (0);
270}
271
272/* XXX */
273static void
274mb_dtor_clust(void *mem, int size, void *arg)
275{

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

332 m->m_next = NULL;
333 m->m_nextpkt = NULL;
334 m->m_data = m->m_ext.ext_buf;
335 m->m_flags = flags|M_EXT;
336 m->m_ext.ext_free = NULL;
337 m->m_ext.ext_args = NULL;
338 m->m_ext.ext_size = MCLBYTES;
339 m->m_ext.ext_type = EXT_PACKET;
266 mbstat.m_mclusts += 1; /* XXX */
267 return (0);
268}
269
270/* XXX */
271static void
272mb_dtor_clust(void *mem, int size, void *arg)
273{

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

330 m->m_next = NULL;
331 m->m_nextpkt = NULL;
332 m->m_data = m->m_ext.ext_buf;
333 m->m_flags = flags|M_EXT;
334 m->m_ext.ext_free = NULL;
335 m->m_ext.ext_args = NULL;
336 m->m_ext.ext_size = MCLBYTES;
337 m->m_ext.ext_type = EXT_PACKET;
340 *(m->m_ext.ref_cnt) = 1;
338 m->m_ext.ref_cnt = NULL; /* Lazy counter assign. */
341
342 if (flags & M_PKTHDR) {
343 m->m_pkthdr.rcvif = NULL;
344 m->m_pkthdr.csum_flags = 0;
345 SLIST_INIT(&m->m_pkthdr.tags);
346#ifdef MAC
347 /* If the label init fails, fail the alloc */
348 error = mac_init_mbuf(m, how);

--- 31 unchanged lines hidden ---
339
340 if (flags & M_PKTHDR) {
341 m->m_pkthdr.rcvif = NULL;
342 m->m_pkthdr.csum_flags = 0;
343 SLIST_INIT(&m->m_pkthdr.tags);
344#ifdef MAC
345 /* If the label init fails, fail the alloc */
346 error = mac_init_mbuf(m, how);

--- 31 unchanged lines hidden ---