uipc_mbuf.c (87594) | uipc_mbuf.c (90227) |
---|---|
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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 | 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 --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)uipc_mbuf.c 8.2 (Berkeley) 1/4/94 |
34 * $FreeBSD: head/sys/kern/uipc_mbuf.c 87594 2001-12-10 05:51:45Z obrien $ | 34 * $FreeBSD: head/sys/kern/uipc_mbuf.c 90227 2002-02-05 02:00:56Z dillon $ |
35 */ 36 37#include "opt_param.h" 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> 41#include <sys/lock.h> 42#include <sys/malloc.h> --- 83 unchanged lines hidden (view full) --- 126failed: 127 m_freem(top); 128 return (NULL); 129} 130 131void 132m_freem(struct mbuf *m) 133{ | 35 */ 36 37#include "opt_param.h" 38#include <sys/param.h> 39#include <sys/systm.h> 40#include <sys/kernel.h> 41#include <sys/lock.h> 42#include <sys/malloc.h> --- 83 unchanged lines hidden (view full) --- 126failed: 127 m_freem(top); 128 return (NULL); 129} 130 131void 132m_freem(struct mbuf *m) 133{ |
134 struct mbuf *n; 135 136 if (m == NULL) 137 return; 138 do { 139 MFREE(m, n); 140 m = n; 141 } while (m); | 134 while (m) { 135 m = m_free(m); 136 } |
142} 143 144/* 145 * Lesser-used path for M_PREPEND: 146 * allocate new mbuf to prepend to chain, 147 * copy junk along. 148 */ 149struct mbuf * --- 603 unchanged lines hidden --- | 137} 138 139/* 140 * Lesser-used path for M_PREPEND: 141 * allocate new mbuf to prepend to chain, 142 * copy junk along. 143 */ 144struct mbuf * --- 603 unchanged lines hidden --- |