diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2016-04-15 05:05:22 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2016-04-15 05:05:22 +0000 |
commit | 754923eb061ab7a49261e9a5c44fd9de91f4fb5f (patch) | |
tree | c1c92a6ca7983d18efd82c3af19680480db2bf27 /sys | |
parent | b1396575ac6ad3b562f4938cc4a03bb6176fd3cc (diff) |
remove ml_filter, mq_filter, niq_filter.
theyre currently unused, so no functional change.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/uipc_mbuf.c | 44 | ||||
-rw-r--r-- | sys/net/if_var.h | 3 | ||||
-rw-r--r-- | sys/sys/mbuf.h | 6 |
3 files changed, 3 insertions, 50 deletions
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) |