Source-Changes-HG archive

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

[src/trunk]: src Remove m_getclr. It is unused, confusing (vs m_clget), and i...



details:   https://anonhg.NetBSD.org/src/rev/9643d8d95137
branches:  trunk
changeset: 321932:9643d8d95137
user:      maxv <maxv%NetBSD.org@localhost>
date:      Tue Apr 10 16:12:29 2018 +0000

description:
Remove m_getclr. It is unused, confusing (vs m_clget), and is a weak
implementation (eg you can't request a zeroed pkthdr mbuf).

diffstat:

 distrib/sets/lists/comp/mi |   8 ++++----
 share/man/man9/Makefile    |   4 ++--
 share/man/man9/mbuf.9      |  18 ++----------------
 sys/kern/uipc_mbuf.c       |  16 ++--------------
 sys/sys/mbuf.h             |   3 +--
 5 files changed, 11 insertions(+), 38 deletions(-)

diffs (159 lines):

diff -r d778f588c96b -r 9643d8d95137 distrib/sets/lists/comp/mi
--- a/distrib/sets/lists/comp/mi        Tue Apr 10 15:29:46 2018 +0000
+++ b/distrib/sets/lists/comp/mi        Tue Apr 10 16:12:29 2018 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: mi,v 1.2186 2018/04/04 04:43:46 kre Exp $
+#      $NetBSD: mi,v 1.2187 2018/04/10 16:12:29 maxv Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 ./etc/mtree/set.comp                           comp-sys-root
@@ -11059,7 +11059,7 @@
 ./usr/share/man/cat9/m_free.0                  comp-sys-catman         .cat
 ./usr/share/man/cat9/m_freem.0                 comp-sys-catman         .cat
 ./usr/share/man/cat9/m_get.0                   comp-sys-catman         .cat
-./usr/share/man/cat9/m_getclr.0                        comp-sys-catman         .cat
+./usr/share/man/cat9/m_getclr.0                        comp-obsolete           obsolete
 ./usr/share/man/cat9/m_gethdr.0                        comp-sys-catman         .cat
 ./usr/share/man/cat9/m_makewritable.0          comp-sys-catman         .cat
 ./usr/share/man/cat9/m_prepend.0               comp-sys-catman         .cat
@@ -18738,7 +18738,7 @@
 ./usr/share/man/html9/m_free.html              comp-sys-htmlman        html
 ./usr/share/man/html9/m_freem.html             comp-sys-htmlman        html
 ./usr/share/man/html9/m_get.html               comp-sys-htmlman        html
-./usr/share/man/html9/m_getclr.html            comp-sys-htmlman        html
+./usr/share/man/html9/m_getclr.html            comp-obsolete   obsolete
 ./usr/share/man/html9/m_gethdr.html            comp-sys-htmlman        html
 ./usr/share/man/html9/m_makewritable.html      comp-sys-htmlman        html
 ./usr/share/man/html9/m_prepend.html           comp-sys-htmlman        html
@@ -26571,7 +26571,7 @@
 ./usr/share/man/man9/m_free.9                  comp-sys-man            .man
 ./usr/share/man/man9/m_freem.9                 comp-sys-man            .man
 ./usr/share/man/man9/m_get.9                   comp-sys-man            .man
-./usr/share/man/man9/m_getclr.9                        comp-sys-man            .man
+./usr/share/man/man9/m_getclr.9                        comp-obsolete           obsolete
 ./usr/share/man/man9/m_gethdr.9                        comp-sys-man            .man
 ./usr/share/man/man9/m_makewritable.9          comp-sys-man            .man
 ./usr/share/man/man9/m_prepend.9               comp-sys-man            .man
diff -r d778f588c96b -r 9643d8d95137 share/man/man9/Makefile
--- a/share/man/man9/Makefile   Tue Apr 10 15:29:46 2018 +0000
+++ b/share/man/man9/Makefile   Tue Apr 10 16:12:29 2018 +0000
@@ -1,4 +1,4 @@
-#       $NetBSD: Makefile,v 1.418 2018/01/17 02:45:38 maya Exp $
+#       $NetBSD: Makefile,v 1.419 2018/04/10 16:12:29 maxv Exp $
 
 #      Makefile for section 9 (kernel function and variable) manual pages.
 
@@ -489,7 +489,7 @@
 MLINKS+=malloc.9 MALLOC_DEFINE.9
 MLINKS+=malloc.9 MALLOC_DECLARE.9
 MLINKS+=mb.9 mb_memory.9 mb.9 mb_read.9 mb.9 mb_write.9
-MLINKS+=mbuf.9 m_get.9 mbuf.9 m_getclr.9 mbuf.9 m_gethdr.9 mbuf.9 m_devget.9 \
+MLINKS+=mbuf.9 m_get.9 mbuf.9 m_gethdr.9 mbuf.9 m_devget.9 \
        mbuf.9 m_copym.9 mbuf.9 m_copypacket.9 mbuf.9 m_copydata.9 \
        mbuf.9 m_copyback.9 mbuf.9 m_cat.9 mbuf.9 m_dup.9 mbuf.9 m_prepend.9 \
        mbuf.9 m_copyback_cow.9 \
diff -r d778f588c96b -r 9643d8d95137 share/man/man9/mbuf.9
--- a/share/man/man9/mbuf.9     Tue Apr 10 15:29:46 2018 +0000
+++ b/share/man/man9/mbuf.9     Tue Apr 10 16:12:29 2018 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: mbuf.9,v 1.56 2018/01/25 09:33:21 maxv Exp $
+.\"    $NetBSD: mbuf.9,v 1.57 2018/04/10 16:12:29 maxv Exp $
 .\"
 .\" Copyright (c) 1997 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,13 +27,12 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 25, 2018
+.Dd April 10, 2018
 .Dt MBUF 9
 .Os
 .Sh NAME
 .Nm mbuf ,
 .Nm m_get ,
-.Nm m_getclr ,
 .Nm m_gethdr ,
 .Nm m_devget ,
 .Nm m_copym ,
@@ -73,8 +72,6 @@
 .Ft struct mbuf *
 .Fn m_get "int nowait" "int type"
 .Ft struct mbuf *
-.Fn m_getclr "int nowait" "int type"
-.Ft struct mbuf *
 .Fn m_gethdr "int nowait" "int type"
 .Ft struct mbuf *
 .Fn m_devget "char *buf" "int totlen" "int off0" "struct ifnet *ifp" "void (*copy)(const void *, void *, size_t)"
@@ -251,17 +248,6 @@
 The
 .Fa type
 parameter is an mbuf type.
-.It Fn m_getclr "int nowait" "int type"
-Allocates an mbuf and initializes it to contain internal data, then
-zeros the data area.
-The
-.Fa nowait
-parameter is a choice of
-.Dv M_WAIT / M_DONTWAIT
-from caller.
-The
-.Fa type
-parameter is an mbuf type.
 .It Fn m_gethdr "int nowait" "int type"
 Allocates an mbuf and initializes it to contain a packet header and internal
 data.
diff -r d778f588c96b -r 9643d8d95137 sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c      Tue Apr 10 15:29:46 2018 +0000
+++ b/sys/kern/uipc_mbuf.c      Tue Apr 10 16:12:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_mbuf.c,v 1.186 2018/04/10 15:29:46 maxv Exp $     */
+/*     $NetBSD: uipc_mbuf.c,v 1.187 2018/04/10 16:12:30 maxv Exp $     */
 
 /*
  * Copyright (c) 1999, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.186 2018/04/10 15:29:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.187 2018/04/10 16:12:30 maxv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_mbuftrace.h"
@@ -643,18 +643,6 @@
        return m;
 }
 
-struct mbuf *
-m_getclr(int nowait, int type)
-{
-       struct mbuf *m;
-
-       m = m_get(nowait, type);
-       if (m == NULL)
-               return NULL;
-       memset(mtod(m, void *), 0, MLEN);
-       return m;
-}
-
 void
 m_clget(struct mbuf *m, int nowait)
 {
diff -r d778f588c96b -r 9643d8d95137 sys/sys/mbuf.h
--- a/sys/sys/mbuf.h    Tue Apr 10 15:29:46 2018 +0000
+++ b/sys/sys/mbuf.h    Tue Apr 10 16:12:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mbuf.h,v 1.181 2018/04/10 15:27:35 maxv Exp $  */
+/*     $NetBSD: mbuf.h,v 1.182 2018/04/10 16:12:30 maxv Exp $  */
 
 /*
  * Copyright (c) 1996, 1997, 1999, 2001, 2007 The NetBSD Foundation, Inc.
@@ -841,7 +841,6 @@
     void (*copy)(const void *, void *, size_t));
 struct mbuf *m_dup(struct mbuf *, int, int, int);
 struct mbuf *m_get(int, int);
-struct mbuf *m_getclr(int, int);
 struct mbuf *m_gethdr(int, int);
 struct mbuf *m_prepend(struct mbuf *,int, int);
 struct mbuf *m_pulldown(struct mbuf *, int, int, int *);



Home | Main Index | Thread Index | Old Index