Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Remove m_copy completely.



details:   https://anonhg.NetBSD.org/src/rev/8a0539605dcc
branches:  trunk
changeset: 832212:8a0539605dcc
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu May 03 07:01:08 2018 +0000

description:
Remove m_copy completely.

diffstat:

 sys/dist/pf/net/pf.c                         |  8 ++++++--
 sys/external/bsd/ipf/netinet/ip_compat.h     |  4 ++--
 sys/external/bsd/ipf/netinet/ip_fil_netbsd.c |  6 +++---
 sys/netinet/dccp_usrreq.c                    |  7 ++++---
 sys/netinet/sctp_output.c                    |  8 ++++----
 sys/sys/mbuf.h                               |  5 +----
 6 files changed, 20 insertions(+), 18 deletions(-)

diffs (159 lines):

diff -r 77f56bf0fa82 -r 8a0539605dcc sys/dist/pf/net/pf.c
--- a/sys/dist/pf/net/pf.c      Thu May 03 06:41:30 2018 +0000
+++ b/sys/dist/pf/net/pf.c      Thu May 03 07:01:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pf.c,v 1.80 2018/02/19 23:03:00 christos Exp $ */
+/*     $NetBSD: pf.c,v 1.81 2018/05/03 07:01:08 maxv Exp $     */
 /*     $OpenBSD: pf.c,v 1.552.2.1 2007/11/27 16:37:57 henning Exp $ */
 
 /*
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.80 2018/02/19 23:03:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pf.c,v 1.81 2018/05/03 07:01:08 maxv Exp $");
 
 #include "pflog.h"
 
@@ -1856,7 +1856,11 @@
        struct pf_mtag  *pf_mtag;
 #endif /* __NetBSD__ */
 
+#ifdef __NetBSD__
+       m0 = m_copym(m, 0, M_COPYALL, M_DONTWAIT);
+#else
        m0 = m_copy(m, 0, M_COPYALL);
+#endif
 
 #ifdef __NetBSD__
        if ((pf_mtag = pf_get_mtag(m0)) == NULL)
diff -r 77f56bf0fa82 -r 8a0539605dcc sys/external/bsd/ipf/netinet/ip_compat.h
--- a/sys/external/bsd/ipf/netinet/ip_compat.h  Thu May 03 06:41:30 2018 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_compat.h  Thu May 03 07:01:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_compat.h,v 1.12 2018/05/01 07:07:00 maxv Exp $      */
+/*     $NetBSD: ip_compat.h,v 1.13 2018/05/03 07:01:08 maxv Exp $      */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -251,7 +251,7 @@
 #  define      MSGDSIZE(m)     mbufchainlen(m)
 #  define      M_LEN(m)        (m)->m_len
 #  define      M_ADJ(m,x)      m_adj(m, x)
-#  define      M_COPY(x)       m_copy((x), 0, M_COPYALL)
+#  define      M_COPY(x)       m_copym((x), 0, M_COPYALL, M_DONTWAIT)
 #  define      GETKTIME(x)     microtime((struct timeval *)x)
 #  define      IPF_PANIC(x,y)  if (x) { printf y; panic("ipf_panic"); }
 #  define      COPYIN(a,b,c)   copyin((void *)(a), (void *)(b), (c))
diff -r 77f56bf0fa82 -r 8a0539605dcc sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
--- a/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c      Thu May 03 06:41:30 2018 +0000
+++ b/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c      Thu May 03 07:01:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_fil_netbsd.c,v 1.26 2017/07/23 06:19:00 christos Exp $      */
+/*     $NetBSD: ip_fil_netbsd.c,v 1.27 2018/05/03 07:01:08 maxv Exp $  */
 
 /*
  * Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.26 2017/07/23 06:19:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.27 2018/05/03 07:01:08 maxv Exp $");
 #else
 static const char sccsid[] = "@(#)ip_fil.c     2.41 6/5/96 (C) 1993-2000 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -1312,7 +1312,7 @@
                else
                        mhip->ip_off |= IP_MF;
                mhip->ip_len = htons((u_short)(len + mhlen));
-               m->m_next = m_copy(m0, off, len);
+               m->m_next = m_copym(m0, off, len, M_DONTWAIT);
                if (m->m_next == 0) {
                        error = ENOBUFS;        /* ??? */
                        goto sendorfree;
diff -r 77f56bf0fa82 -r 8a0539605dcc sys/netinet/dccp_usrreq.c
--- a/sys/netinet/dccp_usrreq.c Thu May 03 06:41:30 2018 +0000
+++ b/sys/netinet/dccp_usrreq.c Thu May 03 07:01:08 2018 +0000
@@ -1,5 +1,5 @@
 /*     $KAME: dccp_usrreq.c,v 1.67 2005/11/03 16:05:04 nishida Exp $   */
-/*     $NetBSD: dccp_usrreq.c,v 1.17 2018/02/08 09:05:20 dholland Exp $ */
+/*     $NetBSD: dccp_usrreq.c,v 1.18 2018/05/03 07:01:08 maxv Exp $ */
 
 /*
  * Copyright (c) 2003 Joacim Häggmark, Magnus Erixzon, Nils-Erik Mattsson 
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.17 2018/02/08 09:05:20 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dccp_usrreq.c,v 1.18 2018/05/03 07:01:08 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -1413,7 +1413,8 @@
                        mtod(m, char *) + hdrlen);
                        m->m_len += len;
                } else {
-                       m->m_next = m_copy(so->so_snd.sb_mb, off, (int) len);
+                       m->m_next = m_copym(so->so_snd.sb_mb, off,
+                           (int)len, M_DONTWAIT);
                        if (m->m_next == 0) {
                                error = ENOBUFS;
                                goto release;
diff -r 77f56bf0fa82 -r 8a0539605dcc sys/netinet/sctp_output.c
--- a/sys/netinet/sctp_output.c Thu May 03 06:41:30 2018 +0000
+++ b/sys/netinet/sctp_output.c Thu May 03 07:01:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sctp_output.c,v 1.14 2018/05/01 07:21:39 maxv Exp $ */
+/*     $NetBSD: sctp_output.c,v 1.15 2018/05/03 07:01:08 maxv Exp $ */
 /*     $KAME: sctp_output.c,v 1.48 2005/06/16 18:29:24 jinmei Exp $    */
 
 /*
@@ -30,7 +30,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sctp_output.c,v 1.14 2018/05/01 07:21:39 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sctp_output.c,v 1.15 2018/05/03 07:01:08 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -4611,7 +4611,7 @@
                appendchain = m_copypacket(clonechain, M_DONTWAIT);
                sctp_pegs[SCTP_CACHED_SRC]++;
        } else
-               appendchain = m_copy(clonechain, 0, M_COPYALL);
+               appendchain = m_copym(clonechain, 0, M_COPYALL, M_DONTWAIT);
 #elif defined(__APPLE__)
        appendchain = sctp_m_copym(clonechain, 0, M_COPYALL, M_DONTWAIT);
 #else
@@ -6400,7 +6400,7 @@
                m_ack = m_copypacket(stcb->asoc.last_asconf_ack_sent, M_DONTWAIT);
                sctp_pegs[SCTP_CACHED_SRC]++;
        } else
-               m_ack = m_copy(stcb->asoc.last_asconf_ack_sent, 0, M_COPYALL);
+               m_ack = m_copym(stcb->asoc.last_asconf_ack_sent, 0, M_COPYALL, M_DONTWAIT);
 #else
                m_ack = m_copy(stcb->asoc.last_asconf_ack_sent, 0, M_COPYALL);
 #endif
diff -r 77f56bf0fa82 -r 8a0539605dcc sys/sys/mbuf.h
--- a/sys/sys/mbuf.h    Thu May 03 06:41:30 2018 +0000
+++ b/sys/sys/mbuf.h    Thu May 03 07:01:08 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbuf.h,v 1.200 2018/04/29 07:13:10 maxv Exp $  */
+/*     $NetBSD: mbuf.h,v 1.201 2018/05/03 07:01:08 maxv Exp $  */
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -636,9 +636,6 @@
 /* The "copy all" special length. */
 #define        M_COPYALL       -1
 
-/* compatibility with 4.3 */
-#define  m_copy(m, o, l)       m_copym((m), (o), (l), M_DONTWAIT)
-
 /*
  * Allow drivers and/or protocols to store private context information.
  */



Home | Main Index | Thread Index | Old Index