Deleted Added
full compact
uipc_mbuf.c (151976) uipc_mbuf.c (152035)
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 151976 2005-11-02 16:20:36Z andre $");
33__FBSDID("$FreeBSD: head/sys/kern/uipc_mbuf.c 152035 2005-11-04 17:20:53Z 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>

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

210void
211mb_free_ext(struct mbuf *m)
212{
213 KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__));
214 KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__));
215
216 /* Free attached storage if this mbuf is the only reference to it. */
217 if (*(m->m_ext.ref_cnt) == 1 ||
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>

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

210void
211mb_free_ext(struct mbuf *m)
212{
213 KASSERT((m->m_flags & M_EXT) == M_EXT, ("%s: M_EXT not set", __func__));
214 KASSERT(m->m_ext.ref_cnt != NULL, ("%s: ref_cnt not set", __func__));
215
216 /* Free attached storage if this mbuf is the only reference to it. */
217 if (*(m->m_ext.ref_cnt) == 1 ||
218 atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 1) {
218 atomic_fetchadd_int(m->m_ext.ref_cnt, -1) == 0) {
219 switch (m->m_ext.ext_type) {
219 switch (m->m_ext.ext_type) {
220 case EXT_CLUSTER:
220 case EXT_CLUSTER: /* The packet zone is special. */
221 if (*(m->m_ext.ref_cnt) == 0)
222 *(m->m_ext.ref_cnt) = 1;
221 uma_zfree(zone_pack, m);
222 return; /* Job done. */
223 break;
224 case EXT_JUMBO9:
225 uma_zfree(zone_jumbo9, m->m_ext.ext_buf);
226 break;
227 case EXT_JUMBO16:
228 uma_zfree(zone_jumbo16, m->m_ext.ext_buf);

--- 1444 unchanged lines hidden ---
223 uma_zfree(zone_pack, m);
224 return; /* Job done. */
225 break;
226 case EXT_JUMBO9:
227 uma_zfree(zone_jumbo9, m->m_ext.ext_buf);
228 break;
229 case EXT_JUMBO16:
230 uma_zfree(zone_jumbo16, m->m_ext.ext_buf);

--- 1444 unchanged lines hidden ---