summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/man/man9/Makefile4
-rw-r--r--share/man/man9/mbuf.914
-rw-r--r--sys/arch/macppc/dev/if_bm.c6
-rw-r--r--sys/arch/macppc/dev/if_mc.c4
-rw-r--r--sys/arch/sparc/dev/hme.c6
-rw-r--r--sys/dev/ic/elink3.c6
-rw-r--r--sys/dev/ic/lance.c6
-rw-r--r--sys/dev/isa/if_ef_isapnp.c4
-rw-r--r--sys/dev/pcmcia/if_cnw.c4
-rw-r--r--sys/dev/pcmcia/if_xe.c4
-rw-r--r--sys/dev/sbus/be.c6
-rw-r--r--sys/dev/sbus/qe.c6
-rw-r--r--sys/kern/uipc_socket.c10
-rw-r--r--sys/kern/uipc_socket2.c8
-rw-r--r--sys/net/if_ppp.c4
-rw-r--r--sys/net/if_pppx.c4
-rw-r--r--sys/net/if_tun.c4
-rw-r--r--sys/net/ppp_tty.c4
-rw-r--r--sys/nfs/nfs_syscalls.c4
-rw-r--r--sys/sys/mbuf.h9
20 files changed, 50 insertions, 67 deletions
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 32d14b252b1..ded507f946c 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.236 2015/07/02 01:35:45 dlg Exp $
+# $OpenBSD: Makefile,v 1.237 2015/07/08 07:21:49 mpi Exp $
# $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $
# Makefile for section 9 (kernel function and variable) manual pages.
@@ -242,7 +242,7 @@ MLINKS+=log.9 addlog.9
MLINKS+=malloc.9 mallocarray.9 malloc.9 free.9
MLINKS+=membar_sync.9 membar_enter.9 membar_sync.9 membar_exit.9 \
membar_sync.9 membar_producer.9 membar_sync.9 membar_consumer.9
-MLINKS+=mbuf.9 m_copym2.9 mbuf.9 m_copym.9 mbuf.9 m_free.9 mbuf.9 MFREE.9 \
+MLINKS+=mbuf.9 m_copym2.9 mbuf.9 m_copym.9 mbuf.9 m_free.9 \
mbuf.9 m_get.9 mbuf.9 MGET.9 mbuf.9 m_getclr.9 mbuf.9 m_gethdr.9 \
mbuf.9 MGETHDR.9 mbuf.9 m_prepend.9 mbuf.9 M_PREPEND.9 \
mbuf.9 m_pulldown.9 mbuf.9 m_pullup.9 \
diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9
index 87e75f7fdf5..d8dc1731c3a 100644
--- a/share/man/man9/mbuf.9
+++ b/share/man/man9/mbuf.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mbuf.9,v 1.87 2015/06/17 06:24:46 mpi Exp $
+.\" $OpenBSD: mbuf.9,v 1.88 2015/07/08 07:21:49 mpi Exp $
.\"
.\" Copyright (c) 2001 Jean-Jacques Bernard-Gundol <jjbg@openbsd.org>
.\" All rights reserved.
@@ -25,7 +25,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 17 2015 $
+.Dd $Mdocdate: July 8 2015 $
.Dt MBUF 9
.Os
.Sh NAME
@@ -39,7 +39,6 @@
.Fn m_copym "struct mbuf *m" "int off" "int len" "int wait"
.Ft struct mbuf *
.Fn m_free "struct mbuf *m"
-.Fn MFREE "struct mbuf *m" "struct mbuf *n"
.Ft struct mbuf *
.Fn m_get "int how" "int type"
.Fn MGET "struct mbuf *m" "int how" "int type"
@@ -393,15 +392,6 @@ Free the mbuf pointed to by
.Fa m .
A pointer to the successor of the mbuf,
if it exists, is returned by the function.
-.It Fn MFREE "struct mbuf *m" "struct mbuf *n"
-Free the mbuf pointed to by
-.Fa m
-and use
-.Fa n
-to point to the next mbuf in
-the chain if it exists.
-See
-.Fn m_free .
.It Fn m_get "int how" "int type"
Return a pointer to an mbuf of the type specified.
If the
diff --git a/sys/arch/macppc/dev/if_bm.c b/sys/arch/macppc/dev/if_bm.c
index a37ab4ec488..d950b1866b5 100644
--- a/sys/arch/macppc/dev/if_bm.c
+++ b/sys/arch/macppc/dev/if_bm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bm.c,v 1.33 2015/06/24 09:40:53 mpi Exp $ */
+/* $OpenBSD: if_bm.c,v 1.34 2015/07/08 07:21:49 mpi Exp $ */
/* $NetBSD: if_bm.c,v 1.1 1999/01/01 01:27:52 tsubai Exp $ */
/*-
@@ -662,13 +662,13 @@ bmac_put(struct bmac_softc *sc, caddr_t buff, struct mbuf *m)
for (; m; m = n) {
len = m->m_len;
if (len == 0) {
- MFREE(m, n);
+ n = m_free(m);
continue;
}
bcopy(mtod(m, caddr_t), buff, len);
buff += len;
tlen += len;
- MFREE(m, n);
+ n = m_free(m);
}
if (tlen > NBPG)
panic("%s: putpacket packet overflow", sc->sc_dev.dv_xname);
diff --git a/sys/arch/macppc/dev/if_mc.c b/sys/arch/macppc/dev/if_mc.c
index bf48196051f..35337042449 100644
--- a/sys/arch/macppc/dev/if_mc.c
+++ b/sys/arch/macppc/dev/if_mc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_mc.c,v 1.21 2015/06/24 09:40:53 mpi Exp $ */
+/* $OpenBSD: if_mc.c,v 1.22 2015/07/08 07:21:49 mpi Exp $ */
/* $NetBSD: if_mc.c,v 1.9.16.1 2006/06/21 14:53:13 yamt Exp $ */
/*-
@@ -850,7 +850,7 @@ maceput(struct mc_softc *sc, struct mbuf *m)
totlen += len;
bcopy(data, buff, len);
buff += len;
- MFREE(m, n);
+ n = m_free(m);
}
if (totlen > PAGE_SIZE)
diff --git a/sys/arch/sparc/dev/hme.c b/sys/arch/sparc/dev/hme.c
index 79d6a966675..f279f69bc4d 100644
--- a/sys/arch/sparc/dev/hme.c
+++ b/sys/arch/sparc/dev/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.70 2015/06/24 09:40:53 mpi Exp $ */
+/* $OpenBSD: hme.c,v 1.71 2015/07/08 07:21:49 mpi Exp $ */
/*
* Copyright (c) 1998 Jason L. Wright (jason@thought.net)
@@ -797,13 +797,13 @@ hme_put(sc, idx, m)
for (; m; m = n) {
len = m->m_len;
if (len == 0) {
- MFREE(m, n);
+ n = m_free(m);
continue;
}
bcopy(mtod(m, caddr_t), buf, len);
buf += len;
tlen += len;
- MFREE(m, n);
+ n = m_free(m);
}
return (tlen);
}
diff --git a/sys/dev/ic/elink3.c b/sys/dev/ic/elink3.c
index 9df535f2022..72395980c77 100644
--- a/sys/dev/ic/elink3.c
+++ b/sys/dev/ic/elink3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: elink3.c,v 1.85 2015/06/24 09:40:54 mpi Exp $ */
+/* $OpenBSD: elink3.c,v 1.86 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: elink3.c,v 1.32 1997/05/14 00:22:00 thorpej Exp $ */
/*
@@ -1025,7 +1025,7 @@ startagain:
} else
bus_space_write_multi_1(iot, ioh, txreg,
data, m->m_len);
- MFREE(m, m0);
+ m0 = m_free(m);
m = m0;
}
} else {
@@ -1040,7 +1040,7 @@ startagain:
} else
bus_space_write_multi_1(iot, ioh, txreg,
data, m->m_len);
- MFREE(m, m0);
+ m0 = m_free(m);
m = m0;
}
}
diff --git a/sys/dev/ic/lance.c b/sys/dev/ic/lance.c
index 287c61f87fa..e8288da9074 100644
--- a/sys/dev/ic/lance.c
+++ b/sys/dev/ic/lance.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lance.c,v 1.7 2015/06/24 09:40:54 mpi Exp $ */
+/* $OpenBSD: lance.c,v 1.8 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: lance.c,v 1.46 2012/02/02 19:43:03 tls Exp $ */
/*-
@@ -334,13 +334,13 @@ lance_put(struct lance_softc *sc, int boff, struct mbuf *m)
for (; m; m = n) {
len = m->m_len;
if (len == 0) {
- MFREE(m, n);
+ n = m_free(m);
continue;
}
(*sc->sc_copytobuf)(sc, mtod(m, void *), boff, len);
boff += len;
tlen += len;
- MFREE(m, n);
+ n = m_free(m);
}
if (tlen < LEMINSIZE) {
(*sc->sc_zerobuf)(sc, boff, LEMINSIZE - tlen);
diff --git a/sys/dev/isa/if_ef_isapnp.c b/sys/dev/isa/if_ef_isapnp.c
index 24fcada01f4..e546c7a7675 100644
--- a/sys/dev/isa/if_ef_isapnp.c
+++ b/sys/dev/isa/if_ef_isapnp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ef_isapnp.c,v 1.29 2015/06/24 09:40:54 mpi Exp $ */
+/* $OpenBSD: if_ef_isapnp.c,v 1.30 2015/07/08 07:21:50 mpi Exp $ */
/*
* Copyright (c) 1999 Jason L. Wright (jason@thought.net)
@@ -310,7 +310,7 @@ startagain:
filler >>= 8;
filler |= m->m_data[(m->m_len & ~3) + i] << 24;
}
- MFREE(m, m0);
+ m0 = m_free(m);
m = m0;
}
diff --git a/sys/dev/pcmcia/if_cnw.c b/sys/dev/pcmcia/if_cnw.c
index cd5000e03a3..a17751a6d3b 100644
--- a/sys/dev/pcmcia/if_cnw.c
+++ b/sys/dev/pcmcia/if_cnw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_cnw.c,v 1.31 2015/06/24 09:40:54 mpi Exp $ */
+/* $OpenBSD: if_cnw.c,v 1.32 2015/07/08 07:21:50 mpi Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -526,7 +526,7 @@ cnw_transmit(sc, m0)
mptr += n;
mbytes -= n;
}
- MFREE(m, m0);
+ m0 = m_free(m);
m = m0;
}
diff --git a/sys/dev/pcmcia/if_xe.c b/sys/dev/pcmcia/if_xe.c
index 12285c9ed6a..c9614908a06 100644
--- a/sys/dev/pcmcia/if_xe.c
+++ b/sys/dev/pcmcia/if_xe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xe.c,v 1.51 2015/06/29 10:24:14 dlg Exp $ */
+/* $OpenBSD: if_xe.c,v 1.52 2015/07/08 07:21:50 mpi Exp $ */
/*
* Copyright (c) 1999 Niklas Hallqvist, Brandon Creighton, Job de Haas
@@ -1135,7 +1135,7 @@ xe_start(ifp)
if (m->m_len & 1)
bus_space_write_1(bst, bsh, offset + EDP,
*(mtod(m, u_int8_t *) + m->m_len - 1));
- MFREE(m, m0);
+ m0 = m_free(m);
m = m0;
}
if (sc->sc_flags & XEF_MOHAWK)
diff --git a/sys/dev/sbus/be.c b/sys/dev/sbus/be.c
index a8b1b394f1e..3bfd201531d 100644
--- a/sys/dev/sbus/be.c
+++ b/sys/dev/sbus/be.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: be.c,v 1.31 2015/06/24 09:40:54 mpi Exp $ */
+/* $OpenBSD: be.c,v 1.32 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: be.c,v 1.26 2001/03/20 15:39:20 pk Exp $ */
/*-
@@ -458,13 +458,13 @@ be_put(struct be_softc *sc, int idx, struct mbuf *m)
for (; m; m = n) {
len = m->m_len;
if (len == 0) {
- MFREE(m, n);
+ n = m_free(m);
continue;
}
bcopy(mtod(m, caddr_t), bp+boff, len);
boff += len;
tlen += len;
- MFREE(m, n);
+ n = m_free(m);
}
return (tlen);
}
diff --git a/sys/dev/sbus/qe.c b/sys/dev/sbus/qe.c
index e8b5a387d75..a6e375927b7 100644
--- a/sys/dev/sbus/qe.c
+++ b/sys/dev/sbus/qe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: qe.c,v 1.29 2015/06/24 09:40:54 mpi Exp $ */
+/* $OpenBSD: qe.c,v 1.30 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: qe.c,v 1.16 2001/03/30 17:30:18 christos Exp $ */
/*-
@@ -379,13 +379,13 @@ qe_put(sc, idx, m)
for (; m; m = n) {
len = m->m_len;
if (len == 0) {
- MFREE(m, n);
+ n = m_free(m);
continue;
}
bcopy(mtod(m, caddr_t), bp+boff, len);
boff += len;
tlen += len;
- MFREE(m, n);
+ n = m_free(m);
}
return (tlen);
}
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index 2ab84530751..cc8b477c3e3 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.140 2015/06/30 15:30:17 mpi Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.141 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -761,7 +761,7 @@ dontblock:
m->m_next = 0;
m = so->so_rcv.sb_mb;
} else {
- MFREE(m, so->so_rcv.sb_mb);
+ so->so_rcv.sb_mb = m_free(m);
m = so->so_rcv.sb_mb;
}
sbsync(&so->so_rcv, nextrecord);
@@ -872,7 +872,7 @@ dontblock:
so->so_rcv.sb_mb = m = m->m_next;
*mp = NULL;
} else {
- MFREE(m, so->so_rcv.sb_mb);
+ so->so_rcv.sb_mb = m_free(m);
m = so->so_rcv.sb_mb;
}
/*
@@ -1271,7 +1271,7 @@ somove(struct socket *so, int wait)
*/
m = so->so_rcv.sb_mb;
sbfree(&so->so_rcv, m);
- MFREE(m, so->so_rcv.sb_mb);
+ so->so_rcv.sb_mb = m_free(m);
sbsync(&so->so_rcv, nextrecord);
}
/*
@@ -1281,7 +1281,7 @@ somove(struct socket *so, int wait)
m = so->so_rcv.sb_mb;
while (m && m->m_type == MT_CONTROL) {
sbfree(&so->so_rcv, m);
- MFREE(m, so->so_rcv.sb_mb);
+ so->so_rcv.sb_mb = m_free(m);
m = so->so_rcv.sb_mb;
sbsync(&so->so_rcv, nextrecord);
}
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index 49e9ccc5492..72064f08861 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket2.c,v 1.61 2015/06/30 15:30:17 mpi Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.62 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
@@ -867,12 +867,12 @@ sbdrop(struct sockbuf *sb, int len)
}
len -= m->m_len;
sbfree(sb, m);
- MFREE(m, mn);
+ mn = m_free(m);
m = mn;
}
while (m && m->m_len == 0) {
sbfree(sb, m);
- MFREE(m, mn);
+ mn = m_free(m);
m = mn;
}
if (m) {
@@ -907,7 +907,7 @@ sbdroprecord(struct sockbuf *sb)
sb->sb_mb = m->m_nextpkt;
do {
sbfree(sb, m);
- MFREE(m, mn);
+ mn = m_free(m);
} while ((m = mn) != NULL);
}
SB_EMPTY_FIXUP(sb);
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index 2dcc8c096bc..2128137fa08 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ppp.c,v 1.85 2015/06/16 11:09:39 mpi Exp $ */
+/* $OpenBSD: if_ppp.c,v 1.86 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */
/*
@@ -1345,7 +1345,7 @@ ppp_inproc(struct ppp_softc *sc, struct mbuf *m)
if (m->m_len <= M_TRAILINGSPACE(mp)) {
bcopy(mtod(m, u_char *), mtod(mp, u_char *) + mp->m_len, m->m_len);
mp->m_len += m->m_len;
- MFREE(m, mp->m_next);
+ mp->m_next = m_free(m);
} else
mp->m_next = m;
m = mp;
diff --git a/sys/net/if_pppx.c b/sys/net/if_pppx.c
index 1f7489a4efd..5ca21636fa5 100644
--- a/sys/net/if_pppx.c
+++ b/sys/net/if_pppx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pppx.c,v 1.39 2015/06/30 13:54:42 mpi Exp $ */
+/* $OpenBSD: if_pppx.c,v 1.40 2015/07/08 07:21:50 mpi Exp $ */
/*
* Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org>
@@ -301,7 +301,7 @@ pppxread(dev_t dev, struct uio *uio, int ioflag)
len = min(uio->uio_resid, m0->m_len);
if (len != 0)
error = uiomovei(mtod(m0, caddr_t), len, uio);
- MFREE(m0, m);
+ m = m_free(m0);
m0 = m;
}
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index fda61c28503..439c66302d0 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tun.c,v 1.148 2015/06/30 13:54:42 mpi Exp $ */
+/* $OpenBSD: if_tun.c,v 1.149 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
@@ -776,7 +776,7 @@ tunread(dev_t dev, struct uio *uio, int ioflag)
len = min(uio->uio_resid, m0->m_len);
if (len != 0)
error = uiomovei(mtod(m0, caddr_t), len, uio);
- MFREE(m0, m);
+ m = m_free(m0);
m0 = m;
}
diff --git a/sys/net/ppp_tty.c b/sys/net/ppp_tty.c
index 24af0237be4..d4abefa3818 100644
--- a/sys/net/ppp_tty.c
+++ b/sys/net/ppp_tty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ppp_tty.c,v 1.34 2015/06/16 11:09:40 mpi Exp $ */
+/* $OpenBSD: ppp_tty.c,v 1.35 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: ppp_tty.c,v 1.12 1997/03/24 21:23:10 christos Exp $ */
/*
@@ -642,7 +642,7 @@ pppasyncstart(struct ppp_softc *sc)
}
/* Finished with this mbuf; free it and move on. */
- MFREE(m, m2);
+ m2 = m_free(m);
m = m2;
if (m == NULL) {
/* Finished a packet */
diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c
index c5a5478e525..cc5f10f41e6 100644
--- a/sys/nfs/nfs_syscalls.c
+++ b/sys/nfs/nfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_syscalls.c,v 1.101 2015/06/16 11:09:40 mpi Exp $ */
+/* $OpenBSD: nfs_syscalls.c,v 1.102 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */
/*
@@ -485,7 +485,7 @@ nfsrv_zapsock(struct nfssvc_sock *slp)
soshutdown(so, SHUT_RDWR);
closef(fp, NULL);
if (slp->ns_nam)
- MFREE(slp->ns_nam, m);
+ m = m_free(slp->ns_nam);
m_freem(slp->ns_raw);
m = slp->ns_rec;
while (m) {
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 7d84825a1ff..68c61e0676f 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.h,v 1.194 2015/06/30 15:30:17 mpi Exp $ */
+/* $OpenBSD: mbuf.h,v 1.195 2015/07/08 07:21:50 mpi Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
@@ -305,13 +305,6 @@ struct mbuf {
#define MCLGETI(m, how, ifp, l) m_clget((m), (how), (l))
/*
- * MFREE(struct mbuf *m, struct mbuf *n)
- * Free a single mbuf and associated external storage.
- * Place the successor, if any, in n.
- */
-#define MFREE(m, n) n = m_free((m))
-
-/*
* Move just m_pkthdr from from to to,
* remove M_PKTHDR and clean flags/tags for from.
*/