summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2016-04-15 05:05:22 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2016-04-15 05:05:22 +0000
commit754923eb061ab7a49261e9a5c44fd9de91f4fb5f (patch)
treec1c92a6ca7983d18efd82c3af19680480db2bf27
parentb1396575ac6ad3b562f4938cc4a03bb6176fd3cc (diff)
remove ml_filter, mq_filter, niq_filter.
theyre currently unused, so no functional change.
-rw-r--r--share/man/man9/ml_init.937
-rw-r--r--share/man/man9/mq_init.937
-rw-r--r--sys/kern/uipc_mbuf.c44
-rw-r--r--sys/net/if_var.h3
-rw-r--r--sys/sys/mbuf.h6
5 files changed, 7 insertions, 120 deletions
diff --git a/share/man/man9/ml_init.9 b/share/man/man9/ml_init.9
index 2f29a05cedb..c9a0ec95761 100644
--- a/share/man/man9/ml_init.9
+++ b/share/man/man9/ml_init.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ml_init.9,v 1.12 2015/11/24 14:56:10 jmc Exp $
+.\" $OpenBSD: ml_init.9,v 1.13 2016/04/15 05:05:21 dlg Exp $
.\"
.\" Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: November 24 2015 $
+.Dd $Mdocdate: April 15 2016 $
.Dt ML_INIT 9
.Os
.Sh NAME
@@ -23,7 +23,6 @@
.Nm ml_dequeue ,
.Nm ml_enlist ,
.Nm ml_dechain ,
-.Nm ml_filter ,
.Nm ml_len ,
.Nm ml_empty ,
.Nm ml_purge ,
@@ -44,12 +43,6 @@
.Fn ml_enlist "struct mbuf_list *ml" "struct mbuf_list *src"
.Ft struct mbuf *
.Fn ml_dechain "struct mbuf_list *ml"
-.Ft struct mbuf *
-.Fo ml_filter
-.Fa "struct mbuf_list *ml"
-.Fa "int (*filter)(void *, struct mbuf *)"
-.Fa "void *context"
-.Fc
.Ft unsigned int
.Fn ml_len "struct mbuf_list *ml"
.Ft int
@@ -102,25 +95,6 @@ mbuf list.
Dequeues all mbufs from the
.Fa ml
mbuf list.
-.It Fo ml_filter
-.Fa "struct mbuf_list *ml"
-.Fa "int (*filter)(void *, struct mbuf *)"
-.Fa "void *context"
-.Fc
-Iterates over the mbufs on the
-.Fa ml
-mbuf list, passing each of them to the
-.Fa filter
-function.
-If the
-.Fa filter
-returns non-zero, the packet is removed from the
-.Fa ml
-mbuf list to be returned as part of an mbuf chain by
-.Fn ml_filter .
-.Fa context
-is passed as the first argument to each call of
-.Fa filter .
.It Fn ml_len "struct mbuf_list *ml"
Return the number of mbufs on the
.Fa ml
@@ -178,13 +152,6 @@ If the list was empty,
.Dv NULL
is returned.
.Pp
-.Fn ml_filter
-returns the mbufs that were successfully matched by the filter
-function on the list via a pointer to a chain of mbufs.
-If no packets matched the filter,
-.Dv NULL
-is returned.
-.Pp
.Fn ml_len
returns the number of mbufs on the list.
.Pp
diff --git a/share/man/man9/mq_init.9 b/share/man/man9/mq_init.9
index c3daf264da7..e37d24b4966 100644
--- a/share/man/man9/mq_init.9
+++ b/share/man/man9/mq_init.9
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mq_init.9,v 1.7 2015/11/24 15:01:53 jmc Exp $
+.\" $OpenBSD: mq_init.9,v 1.8 2016/04/15 05:05:21 dlg Exp $
.\"
.\" Copyright (c) 2015 David Gwynne <dlg@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: November 24 2015 $
+.Dd $Mdocdate: April 15 2016 $
.Dt MQ_INIT 9
.Os
.Sh NAME
@@ -24,7 +24,6 @@
.Nm mq_enlist ,
.Nm mq_delist ,
.Nm mq_dechain ,
-.Nm mq_filter ,
.Nm mq_len ,
.Nm mq_empty ,
.Nm mq_purge ,
@@ -46,12 +45,6 @@
.Fn mq_delist "struct mbuf_queue *mq" "struct mbuf_list *ml"
.Ft struct mbuf *
.Fn mq_dechain "struct mbuf_queue *mq"
-.Ft struct mbuf *
-.Fo mq_filter
-.Fa "struct mbuf_queue *mq"
-.Fa "int (*filter)(void *, struct mbuf *)"
-.Fa "void *context"
-.Fc
.Ft unsigned int
.Fn mq_len "struct mbuf_queue *mq"
.Ft int
@@ -134,25 +127,6 @@ mbuf list.
Dequeue all mbufs from the
.Fa mq
mbuf queue.
-.It Fo mq_filter
-.Fa "struct mbuf_queue *mq"
-.Fa "int (*filter)(void *, struct mbuf *)"
-.Fa "void *context"
-.Fc
-Iterates over the mbufs on the
-.Fa mq
-mbuf queue, passing each of them to the
-.Fa filter
-function.
-If the
-.Fa filter
-returns non-zero, the packet is removed from the
-.Fa mq
-mbuf queue to be returned as part of an mbuf chain by
-.Fn mq_filter .
-.Fa context
-is passed as the first argument to each call of
-.Fa filter .
.It Fn mq_len "struct mbuf_queue *mq"
Return the number of mbufs on the
.Fa mq
@@ -209,13 +183,6 @@ If the queue was empty,
.Dv NULL
is returned.
.Pp
-.Fn mq_filter
-returns the mbufs that were successfully matched by the filter
-function on the queue via a pointer to a chain of mbufs.
-If no packets matched the filter,
-.Dv NULL
-is returned.
-.Pp
.Fn mq_len
returns the number of mbufs on the queue.
.Pp
diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c
index 9722b7b171d..b84d42ea1ea 100644
--- a/sys/kern/uipc_mbuf.c
+++ b/sys/kern/uipc_mbuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_mbuf.c,v 1.223 2016/04/08 03:13:38 dlg Exp $ */
+/* $OpenBSD: uipc_mbuf.c,v 1.224 2016/04/15 05:05:21 dlg Exp $ */
/* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */
/*
@@ -1396,35 +1396,6 @@ ml_dechain(struct mbuf_list *ml)
return (m0);
}
-struct mbuf *
-ml_filter(struct mbuf_list *ml,
- int (*filter)(void *, const struct mbuf *), void *ctx)
-{
- struct mbuf_list matches = MBUF_LIST_INITIALIZER();
- struct mbuf *m, *n;
- struct mbuf **mp;
-
- mp = &ml->ml_head;
-
- for (m = ml->ml_head; m != NULL; m = n) {
- n = m->m_nextpkt;
- if ((*filter)(ctx, m)) {
- *mp = n;
- ml_enqueue(&matches, m);
- } else {
- mp = &m->m_nextpkt;
- ml->ml_tail = m;
- }
- }
-
- /* fixup ml */
- if (ml->ml_head == NULL)
- ml->ml_tail = NULL;
- ml->ml_len -= ml_len(&matches);
-
- return (matches.ml_head); /* ml_dechain */
-}
-
unsigned int
ml_purge(struct mbuf_list *ml)
{
@@ -1530,19 +1501,6 @@ mq_dechain(struct mbuf_queue *mq)
return (m0);
}
-struct mbuf *
-mq_filter(struct mbuf_queue *mq,
- int (*filter)(void *, const struct mbuf *), void *ctx)
-{
- struct mbuf *m0;
-
- mtx_enter(&mq->mq_mtx);
- m0 = ml_filter(&mq->mq_list, filter, ctx);
- mtx_leave(&mq->mq_mtx);
-
- return (m0);
-}
-
unsigned int
mq_purge(struct mbuf_queue *mq)
{
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 83952e3526a..d0f4e342c39 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_var.h,v 1.70 2016/04/13 11:41:15 mpi Exp $ */
+/* $OpenBSD: if_var.h,v 1.71 2016/04/15 05:05:21 dlg Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
@@ -281,7 +281,6 @@ int niq_enlist(struct niqueue *, struct mbuf_list *);
#define niq_dequeue(_q) mq_dequeue(&(_q)->ni_q)
#define niq_dechain(_q) mq_dechain(&(_q)->ni_q)
#define niq_delist(_q, _ml) mq_delist(&(_q)->ni_q, (_ml))
-#define niq_filter(_q, _f, _c) mq_filter(&(_q)->ni_q, (_f), (_c))
#define niq_len(_q) mq_len(&(_q)->ni_q)
#define niq_drops(_q) mq_drops(&(_q)->ni_q)
#define sysctl_niq(_n, _l, _op, _olp, _np, _nl, _niq) \
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h
index 21de01a437a..27c4471b01c 100644
--- a/sys/sys/mbuf.h
+++ b/sys/sys/mbuf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mbuf.h,v 1.211 2016/04/08 03:13:38 dlg Exp $ */
+/* $OpenBSD: mbuf.h,v 1.212 2016/04/15 05:05:21 dlg Exp $ */
/* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */
/*
@@ -497,8 +497,6 @@ void ml_enqueue(struct mbuf_list *, struct mbuf *);
struct mbuf * ml_dequeue(struct mbuf_list *);
void ml_enlist(struct mbuf_list *, struct mbuf_list *);
struct mbuf * ml_dechain(struct mbuf_list *);
-struct mbuf * ml_filter(struct mbuf_list *,
- int (*)(void *, const struct mbuf *), void *);
unsigned int ml_purge(struct mbuf_list *);
#define ml_len(_ml) ((_ml)->ml_len)
@@ -525,8 +523,6 @@ struct mbuf * mq_dequeue(struct mbuf_queue *);
int mq_enlist(struct mbuf_queue *, struct mbuf_list *);
void mq_delist(struct mbuf_queue *, struct mbuf_list *);
struct mbuf * mq_dechain(struct mbuf_queue *);
-struct mbuf * mq_filter(struct mbuf_queue *,
- int (*)(void *, const struct mbuf *), void *);
unsigned int mq_purge(struct mbuf_queue *);
#define mq_len(_mq) ml_len(&(_mq)->mq_list)