Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Stop adding '0's in parameter and function name...
details: https://anonhg.NetBSD.org/src/rev/d61224836dc9
branches: trunk
changeset: 318475:d61224836dc9
user: maxv <maxv%NetBSD.org@localhost>
date: Thu Apr 26 08:13:30 2018 +0000
description:
Stop adding '0's in parameter and function names, that's just misleading.
Some remain, they need more investigation.
diffstat:
share/man/man9/mbuf.9 | 18 +++++++++---------
sys/kern/uipc_mbuf.c | 36 +++++++++++++++---------------------
2 files changed, 24 insertions(+), 30 deletions(-)
diffs (166 lines):
diff -r 7c30f59dcd6b -r d61224836dc9 share/man/man9/mbuf.9
--- a/share/man/man9/mbuf.9 Thu Apr 26 08:11:18 2018 +0000
+++ b/share/man/man9/mbuf.9 Thu Apr 26 08:13:30 2018 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: mbuf.9,v 1.58 2018/04/26 07:48:21 maxv Exp $
+.\" $NetBSD: mbuf.9,v 1.59 2018/04/26 08:13:30 maxv Exp $
.\"
.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
.\" All rights reserved.
@@ -75,7 +75,7 @@
.Ft struct mbuf *
.Fn m_devget "char *buf" "int totlen" "int off0" "struct ifnet *ifp" "void (*copy)(const void *, void *, size_t)"
.Ft struct mbuf *
-.Fn m_copym "struct mbuf *m" "int off0" "int len" "int wait"
+.Fn m_copym "struct mbuf *m" "int off" "int len" "int wait"
.Ft struct mbuf *
.Fn m_copypacket "struct mbuf *m" "int how"
.Ft void
@@ -89,7 +89,7 @@
.Ft void
.Fn m_cat "struct mbuf *m" "struct mbuf *n"
.Ft struct mbuf *
-.Fn m_dup "struct mbuf *m" "int off0" "int len" "int wait"
+.Fn m_dup "struct mbuf *m" "int off" "int len" "int wait"
.Ft struct mbuf *
.Fn m_pulldown "struct mbuf *m" "int off" "int len" "int *offp"
.Ft struct mbuf *
@@ -97,7 +97,7 @@
.Ft struct mbuf *
.Fn m_copyup "struct mbuf *m" "int len" "int dstoff"
.Ft struct mbuf *
-.Fn m_split "struct mbuf *m0" "int len0" "int wait"
+.Fn m_split "struct mbuf *m0" "int len" "int wait"
.Ft void
.Fn m_adj "struct mbuf *mp" "int req_len"
.Ft int
@@ -267,9 +267,9 @@
.Fa off
bytes plus the type and length fields will be skipped before copying.
Returns the top of the mbuf chain it created.
-.It Fn m_copym "struct mbuf *m" "int off0" "int len" "int wait"
+.It Fn m_copym "struct mbuf *m" "int off" "int len" "int wait"
Creates a copy of an mbuf chain starting
-.Fa off0
+.Fa off
bytes from the beginning, continuing for
.Fa len
bytes.
@@ -385,11 +385,11 @@
Both chains must be of the same type; packet headers will
.Em not
be updated if present.
-.It Fn m_dup "struct mbuf *m" "int off0" "int len" "int wait"
+.It Fn m_dup "struct mbuf *m" "int off" "int len" "int wait"
Similarly to
.Fn m_copym ,
the function creates a copy of an mbuf chain starting
-.Fa off0
+.Fa off
bytes from the beginning, continuing for
.Fa len
bytes.
@@ -475,7 +475,7 @@
.Fa len + dstoff
must be less than
.Dv MHLEN .
-.It Fn m_split "struct mbuf *m0" "int len0" "int wait"
+.It Fn m_split "struct mbuf *m0" "int len" "int wait"
Partitions an mbuf chain in two pieces, returning the tail,
which is all but the first
.Fa len0
diff -r 7c30f59dcd6b -r d61224836dc9 sys/kern/uipc_mbuf.c
--- a/sys/kern/uipc_mbuf.c Thu Apr 26 08:11:18 2018 +0000
+++ b/sys/kern/uipc_mbuf.c Thu Apr 26 08:13:30 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_mbuf.c,v 1.194 2018/04/26 07:46:24 maxv Exp $ */
+/* $NetBSD: uipc_mbuf.c,v 1.195 2018/04/26 08:13: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.194 2018/04/26 07:46:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_mbuf.c,v 1.195 2018/04/26 08:13:30 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_mbuftrace.h"
@@ -102,8 +102,8 @@
static struct sysctllog *mbuf_sysctllog;
-static struct mbuf *m_copym0(struct mbuf *, int, int, int, bool);
-static struct mbuf *m_split0(struct mbuf *, int, int, bool);
+static struct mbuf *m_copy_internal(struct mbuf *, int, int, int, bool);
+static struct mbuf *m_split_internal(struct mbuf *, int, int, bool);
static int m_copyback0(struct mbuf **, int, int, const void *, int, int);
/* flags for m_copyback0 */
@@ -717,17 +717,17 @@
* The wait parameter is a choice of M_WAIT/M_DONTWAIT from caller.
*/
struct mbuf *
-m_copym(struct mbuf *m, int off0, int len, int wait)
+m_copym(struct mbuf *m, int off, int len, int wait)
{
-
- return m_copym0(m, off0, len, wait, false); /* shallow copy on M_EXT */
+ /* Shallow copy on M_EXT. */
+ return m_copy_internal(m, off, len, wait, false);
}
struct mbuf *
-m_dup(struct mbuf *m, int off0, int len, int wait)
+m_dup(struct mbuf *m, int off, int len, int wait)
{
-
- return m_copym0(m, off0, len, wait, true); /* deep copy */
+ /* Deep copy. */
+ return m_copy_internal(m, off, len, wait, true);
}
static inline int
@@ -737,7 +737,7 @@
}
static struct mbuf *
-m_copym0(struct mbuf *m, int off0, int len, int wait, bool deep)
+m_copy_internal(struct mbuf *m, int off0, int len, int wait, bool deep)
{
struct mbuf *n, **np;
int off = off0;
@@ -1145,20 +1145,14 @@
return (NULL);
}
-/*
- * Partition an mbuf chain in two pieces, returning the tail --
- * all but the first len0 bytes. In case of failure, it returns NULL and
- * attempts to restore the chain to its original state.
- */
struct mbuf *
-m_split(struct mbuf *m0, int len0, int wait)
+m_split(struct mbuf *m0, int len, int wait)
{
-
- return m_split0(m0, len0, wait, true);
+ return m_split_internal(m0, len, wait, true);
}
static struct mbuf *
-m_split0(struct mbuf *m0, int len0, int wait, bool copyhdr)
+m_split_internal(struct mbuf *m0, int len0, int wait, bool copyhdr)
{
struct mbuf *m, *n;
unsigned len = len0, remain, len_save;
@@ -1533,7 +1527,7 @@
* a mbuf, split it first.
*/
if (off > 0) {
- n = m_split0(m, off, how, false);
+ n = m_split_internal(m, off, how, false);
if (n == NULL)
goto enobufs;
m->m_next = n;
Home |
Main Index |
Thread Index |
Old Index