From: dlg Date: Thu, 22 Oct 2015 05:26:06 +0000 (+0000) Subject: rename ml_join to ml_enlist and expose it to the rest of the kernel. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=e4e00e5d127fdaeec22e76dfdb936169dad010a4;p=openbsd rename ml_join to ml_enlist and expose it to the rest of the kernel. --- diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile index 9d2af27ac34..7017fa23644 100644 --- a/share/man/man9/Makefile +++ b/share/man/man9/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.247 2015/10/21 08:48:12 mpi Exp $ +# $OpenBSD: Makefile,v 1.248 2015/10/22 05:26:06 dlg Exp $ # $NetBSD: Makefile,v 1.4 1996/01/09 03:23:01 thorpej Exp $ # Makefile for section 9 (kernel function and variable) manual pages. @@ -267,7 +267,7 @@ MLINKS+=microtime.9 getmicrotime.9 microtime.9 microuptime.9 \ microtime.9 getnanouptime.9 microtime.9 bintime.9 \ microtime.9 binuptime.9 MLINKS+=ml_init.9 ml_enqueue.9 ml_init.9 ml_dequeue.9 ml_init.9 ml_requeue.9 \ - ml_init.9 ml_dechain.9 \ + ml_init.9 ml_enlist.9 ml_init.9 ml_dechain.9 \ ml_init.9 ml_filter.9 ml_init.9 ml_len.9 ml_init.9 ml_empty.9 \ ml_init.9 MBUF_LIST_INITIALIZER.9 ml_init.9 MBUF_LIST_FOREACH.9 MLINKS+=mountroothook_establish.9 mountroothook_disestablish.9 diff --git a/share/man/man9/ml_init.9 b/share/man/man9/ml_init.9 index 7f0a5b71d69..272df87b21f 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.6 2015/10/02 09:24:13 sobrado Exp $ +.\" $OpenBSD: ml_init.9,v 1.7 2015/10/22 05:26:06 dlg Exp $ .\" .\" Copyright (c) 2015 David Gwynne .\" @@ -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: October 2 2015 $ +.Dd $Mdocdate: October 22 2015 $ .Dt ML_INIT 9 .Os .Sh NAME @@ -22,6 +22,7 @@ .Nm ml_enqueue , .Nm ml_dequeue , .Nm ml_requeue , +.Nm ml_enlist , .Nm ml_dechain , .Nm ml_len , .Nm ml_empty , @@ -38,6 +39,8 @@ .Fn ml_dequeue "struct mbuf_list *ml" .Ft void .Fn ml_requeue "struct mbuf_list *ml" "struct mbuf *m" +.Ft void +.Fn ml_enlist "struct mbuf_list *ml" "struct mbuf_list *src" .Ft struct mbuf * .Fn ml_dechain "struct mbuf_list *ml" .Ft struct mbuf * @@ -92,6 +95,12 @@ Enqueue mbuf at the head of the .Fa ml mbuf list. +.It Fn ml_enlist "struct mbuf_list *ml" "struct mbuf_list *src" +Enqueue all the mbufs on the +.Fa src +mbuf list on to the end of the +.Fa ml +mbuf list. .It Fn ml_dechain "struct mbuf_list *ml" Dequeues all mbufs from the .Fa ml @@ -137,6 +146,7 @@ Note that it is unsafe to modify the list while iterating over it. .Fn ml_enqueue , .Fn ml_dequeue , .Fn ml_requeue , +.Fn ml_enlist , .Fn ml_dechain , .Fn ml_len , .Fn ml_empty , diff --git a/sys/kern/uipc_mbuf.c b/sys/kern/uipc_mbuf.c index a09bc982ea6..79443d4cb3b 100644 --- a/sys/kern/uipc_mbuf.c +++ b/sys/kern/uipc_mbuf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_mbuf.c,v 1.207 2015/08/14 05:25:29 dlg Exp $ */ +/* $OpenBSD: uipc_mbuf.c,v 1.208 2015/10/22 05:26:06 dlg Exp $ */ /* $NetBSD: uipc_mbuf.c,v 1.15.4.1 1996/06/13 17:11:44 cgd Exp $ */ /* @@ -1243,8 +1243,6 @@ m_print(void *v, * mbuf lists */ -void ml_join(struct mbuf_list *, struct mbuf_list *); - void ml_init(struct mbuf_list *ml) { @@ -1267,7 +1265,7 @@ ml_enqueue(struct mbuf_list *ml, struct mbuf *m) } void -ml_join(struct mbuf_list *mla, struct mbuf_list *mlb) +ml_enlist(struct mbuf_list *mla, struct mbuf_list *mlb) { if (!ml_empty(mlb)) { if (ml_empty(mla)) @@ -1418,7 +1416,7 @@ mq_enlist(struct mbuf_queue *mq, struct mbuf_list *ml) mtx_enter(&mq->mq_mtx); if (mq_len(mq) < mq->mq_maxlen) - ml_join(&mq->mq_list, ml); + ml_enlist(&mq->mq_list, ml); else { dropped = ml_len(ml); mq->mq_drops += dropped; diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index 3d8082b35e1..69ec7f2fb27 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mbuf.h,v 1.197 2015/10/08 11:36:15 dlg Exp $ */ +/* $OpenBSD: mbuf.h,v 1.198 2015/10/22 05:26:06 dlg Exp $ */ /* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */ /* @@ -487,6 +487,7 @@ void ml_init(struct mbuf_list *); void ml_enqueue(struct mbuf_list *, struct mbuf *); struct mbuf * ml_dequeue(struct mbuf_list *); void ml_requeue(struct mbuf_list *, struct mbuf *); +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 *);