summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornaddy <naddy@openbsd.org>2012-04-11 13:29:14 +0000
committernaddy <naddy@openbsd.org>2012-04-11 13:29:14 +0000
commit61f9916f1557c79e150c5c1182e3e134f83c127a (patch)
tree7f3d4cb73a08bbac07c3de04872c1a8057ce0c37
parentdon't spin in accept() when out of fds (ENFILE/ENFILE) - back off for a (diff)
downloadwireguard-openbsd-61f9916f1557c79e150c5c1182e3e134f83c127a.tar.xz
wireguard-openbsd-61f9916f1557c79e150c5c1182e3e134f83c127a.zip
SLIST_REMOVE_NEXT -> SLIST_REMOVE_AFTER for better consistency and
compatibility with FreeBSD/NetBSD. Also rename SIMPLEQ_REMOVE_NEXT to SIMPLEQ_REMOVE_AFTER. ok mikeb@ guenther@
-rw-r--r--share/man/man3/Makefile6
-rw-r--r--share/man/man3/queue.342
-rw-r--r--sys/dev/pci/mpii.c4
-rw-r--r--sys/kern/sysv_sem.c4
-rw-r--r--sys/net/pf.c4
-rw-r--r--sys/sys/queue.h6
6 files changed, 33 insertions, 33 deletions
diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile
index fe2c51d0e14..808c83ed465 100644
--- a/share/man/man3/Makefile
+++ b/share/man/man3/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.24 2012/01/11 00:06:48 bluhm Exp $
+# $OpenBSD: Makefile,v 1.25 2012/04/11 13:29:14 naddy Exp $
# @(#)Makefile 8.2 (Berkeley) 12/13/93
MAN= assert.3 bitstring.3 CMSG_DATA.3 dlfcn.3 dl_iterate_phdr.3 end.3 \
@@ -17,7 +17,7 @@ MLINKS+=queue.3 SLIST_ENTRY.3 queue.3 SLIST_HEAD.3 \
queue.3 SLIST_FOREACH.3 queue.3 SLIST_FOREACH_SAFE.3 \
queue.3 SLIST_INIT.3 \
queue.3 SLIST_INSERT_AFTER.3 queue.3 SLIST_INSERT_HEAD.3 \
- queue.3 SLIST_REMOVE_HEAD.3 queue.3 SLIST_REMOVE_NEXT.3 \
+ queue.3 SLIST_REMOVE_AFTER.3 queue.3 SLIST_REMOVE_HEAD.3 \
queue.3 SLIST_REMOVE.3
MLINKS+=queue.3 LIST_ENTRY.3 queue.3 LIST_HEAD.3 \
queue.3 LIST_HEAD_INITIALIZER.3 queue.3 LIST_FIRST.3 \
@@ -34,7 +34,7 @@ MLINKS+=queue.3 SIMPLEQ_ENTRY.3 queue.3 SIMPLEQ_HEAD.3 \
queue.3 SIMPLEQ_FOREACH_SAFE.3 queue.3 SIMPLEQ_INIT.3 \
queue.3 SIMPLEQ_INSERT_HEAD.3 queue.3 SIMPLEQ_INSERT_TAIL.3 \
queue.3 SIMPLEQ_INSERT_AFTER.3 queue.3 SIMPLEQ_REMOVE_HEAD.3 \
- queue.3 SIMPLEQ_REMOVE_NEXT.3
+ queue.3 SIMPLEQ_REMOVE_AFTER.3
MLINKS+=queue.3 TAILQ_ENTRY.3 queue.3 TAILQ_HEAD.3 \
queue.3 TAILQ_HEAD_INITIALIZER.3 queue.3 TAILQ_FIRST.3 \
queue.3 TAILQ_NEXT.3 queue.3 TAILQ_END.3 queue.3 TAILQ_LAST.3 \
diff --git a/share/man/man3/queue.3 b/share/man/man3/queue.3
index dc19e99ba46..04d99538ba6 100644
--- a/share/man/man3/queue.3
+++ b/share/man/man3/queue.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: queue.3,v 1.55 2012/03/06 23:41:59 haesbaert Exp $
+.\" $OpenBSD: queue.3,v 1.56 2012/04/11 13:29:14 naddy Exp $
.\" $NetBSD: queue.3,v 1.4 1995/07/03 00:25:36 mycroft Exp $
.\"
.\" Copyright (c) 1993 The Regents of the University of California.
@@ -30,7 +30,7 @@
.\"
.\" @(#)queue.3 8.1 (Berkeley) 12/13/93
.\"
-.Dd $Mdocdate: March 6 2012 $
+.Dd $Mdocdate: April 11 2012 $
.Dt QUEUE 3
.Os
.Sh NAME
@@ -46,8 +46,8 @@
.Nm SLIST_INIT ,
.Nm SLIST_INSERT_AFTER ,
.Nm SLIST_INSERT_HEAD ,
+.Nm SLIST_REMOVE_AFTER ,
.Nm SLIST_REMOVE_HEAD ,
-.Nm SLIST_REMOVE_NEXT ,
.Nm SLIST_REMOVE ,
.Nm LIST_ENTRY ,
.Nm LIST_HEAD ,
@@ -74,11 +74,11 @@
.Nm SIMPLEQ_FOREACH ,
.Nm SIMPLEQ_FOREACH_SAFE ,
.Nm SIMPLEQ_INIT ,
+.Nm SIMPLEQ_INSERT_AFTER ,
.Nm SIMPLEQ_INSERT_HEAD ,
.Nm SIMPLEQ_INSERT_TAIL ,
-.Nm SIMPLEQ_INSERT_AFTER ,
+.Nm SIMPLEQ_REMOVE_AFTER ,
.Nm SIMPLEQ_REMOVE_HEAD ,
-.Nm SIMPLEQ_REMOVE_NEXT ,
.Nm TAILQ_ENTRY ,
.Nm TAILQ_HEAD ,
.Nm TAILQ_HEAD_INITIALIZER ,
@@ -142,9 +142,9 @@
.Ft void
.Fn SLIST_INSERT_HEAD "SLIST_HEAD *head" "struct TYPE *elm" "SLIST_ENTRY NAME"
.Ft void
-.Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME"
+.Fn SLIST_REMOVE_AFTER "struct TYPE *elm" "SLIST_ENTRY NAME"
.Ft void
-.Fn SLIST_REMOVE_NEXT "SLIST_HEAD *head" "struct TYPE *elm" "SLIST_ENTRY NAME"
+.Fn SLIST_REMOVE_HEAD "SLIST_HEAD *head" "SLIST_ENTRY NAME"
.Ft void
.Fn SLIST_REMOVE "SLIST_HEAD *head" "struct TYPE *elm" "TYPE" "SLIST_ENTRY NAME"
.Pp
@@ -190,15 +190,15 @@
.Ft void
.Fn SIMPLEQ_INIT "SIMPLEQ_HEAD *head"
.Ft void
+.Fn SIMPLEQ_INSERT_AFTER "SIMPLEQ_HEAD *head" "struct TYPE *listelm" "struct TYPE *elm" "SIMPLEQ_ENTRY NAME"
+.Ft void
.Fn SIMPLEQ_INSERT_HEAD "SIMPLEQ_HEAD *head" "struct TYPE *elm" "SIMPLEQ_ENTRY NAME"
.Ft void
.Fn SIMPLEQ_INSERT_TAIL "SIMPLEQ_HEAD *head" "struct TYPE *elm" "SIMPLEQ_ENTRY NAME"
.Ft void
-.Fn SIMPLEQ_INSERT_AFTER "SIMPLEQ_HEAD *head" "struct TYPE *listelm" "struct TYPE *elm" "SIMPLEQ_ENTRY NAME"
+.Fn SIMPLEQ_REMOVE_AFTER "SIMPLEQ_HEAD *head" "struct TYPE *elm" "SIMPLEQ_ENTRY NAME"
.Ft void
.Fn SIMPLEQ_REMOVE_HEAD "SIMPLEQ_HEAD *head" "SIMPLEQ_ENTRY NAME"
-.Ft void
-.Fn SIMPLEQ_REMOVE_NEXT "SIMPLEQ_HEAD *head" "struct TYPE *elm" "SIMPLEQ_ENTRY NAME"
.Pp
.Fn TAILQ_ENTRY "TYPE"
.Fn TAILQ_HEAD "HEADNAME" "TYPE"
@@ -472,7 +472,7 @@ macro removes the first element of the list pointed by
.Fa head .
.Pp
The
-.Fn SLIST_REMOVE_NEXT
+.Fn SLIST_REMOVE_AFTER
macro removes the list element immediately following
.Fa elm .
.Pp
@@ -733,6 +733,13 @@ SIMPLEQ_HEAD(HEADNAME, TYPE) head = SIMPLEQ_HEAD_INITIALIZER(head);
.Ed
.Pp
The
+.Fn SIMPLEQ_INSERT_AFTER
+macro inserts the new element
+.Fa elm
+after the element
+.Fa listelm .
+.Pp
+The
.Fn SIMPLEQ_INSERT_HEAD
macro inserts the new element
.Fa elm
@@ -745,11 +752,9 @@ macro inserts the new element
at the end of the queue.
.Pp
The
-.Fn SIMPLEQ_INSERT_AFTER
-macro inserts the new element
-.Fa elm
-after the element
-.Fa listelm .
+.Fn SIMPLEQ_REMOVE_AFTER
+macro removes the queue element immediately following
+.Fa elm .
.Pp
The
.Fn SIMPLEQ_REMOVE_HEAD
@@ -757,11 +762,6 @@ macro removes the first element
from the queue.
.Pp
The
-.Fn SIMPLEQ_REMOVE_NEXT
-macro removes the queue element immediately following
-.Fa elm .
-.Pp
-The
.Fn SIMPLEQ_FIRST
and
.Fn SIMPLEQ_NEXT
diff --git a/sys/dev/pci/mpii.c b/sys/dev/pci/mpii.c
index 7e6843c31f4..322bfc26671 100644
--- a/sys/dev/pci/mpii.c
+++ b/sys/dev/pci/mpii.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpii.c,v 1.50 2011/11/03 20:08:49 mikeb Exp $ */
+/* $OpenBSD: mpii.c,v 1.51 2012/04/11 13:29:14 naddy Exp $ */
/*
* Copyright (c) 2010 Mike Belopuhov <mkb@crypt.org.ru>
* Copyright (c) 2009 James Giannoules
@@ -4592,7 +4592,7 @@ mpii_scsi_cmd_done(struct mpii_ccb *ccb)
else {
SIMPLEQ_FOREACH(tccb, &sc->sc_ccb_tmos, ccb_link) {
if (SIMPLEQ_NEXT(tccb, ccb_link) == ccb) {
- SIMPLEQ_REMOVE_NEXT(&sc->sc_ccb_tmos,
+ SIMPLEQ_REMOVE_AFTER(&sc->sc_ccb_tmos,
tccb, ccb_link);
break;
}
diff --git a/sys/kern/sysv_sem.c b/sys/kern/sysv_sem.c
index 6a44c32d619..1a4caada430 100644
--- a/sys/kern/sysv_sem.c
+++ b/sys/kern/sysv_sem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysv_sem.c,v 1.42 2012/01/10 23:12:13 bluhm Exp $ */
+/* $OpenBSD: sysv_sem.c,v 1.43 2012/04/11 13:29:14 naddy Exp $ */
/* $NetBSD: sysv_sem.c,v 1.26 1996/02/09 19:00:25 christos Exp $ */
/*
@@ -210,7 +210,7 @@ semundo_clear(int semid, int semnum)
if (suptr == SLIST_FIRST(&semu_list))
SLIST_REMOVE_HEAD(&semu_list, un_next);
else
- SLIST_REMOVE_NEXT(&semu_list, suprev, un_next);
+ SLIST_REMOVE_AFTER(suprev, un_next);
suptr = SLIST_NEXT(suptr, un_next);
pool_put(&semu_pool, sutmp);
semutot--;
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 02a6507a63d..69cf407522d 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.803 2012/04/03 15:09:03 mikeb Exp $ */
+/* $OpenBSD: pf.c,v 1.804 2012/04/11 13:29:14 naddy Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -617,7 +617,7 @@ pf_state_rm_src_node(struct pf_state *s, struct pf_src_node *sn)
snin = SLIST_NEXT(sni, next);
if (sni->sn == sn) {
if (snip)
- SLIST_REMOVE_NEXT(&s->src_nodes, snip, next);
+ SLIST_REMOVE_AFTER(snip, next);
else
SLIST_REMOVE_HEAD(&s->src_nodes, next);
pool_put(&pf_sn_item_pl, sni);
diff --git a/sys/sys/queue.h b/sys/sys/queue.h
index fb23a72f759..622301d1ca8 100644
--- a/sys/sys/queue.h
+++ b/sys/sys/queue.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: queue.h,v 1.35 2012/01/11 00:06:48 bluhm Exp $ */
+/* $OpenBSD: queue.h,v 1.36 2012/04/11 13:29:14 naddy Exp $ */
/* $NetBSD: queue.h,v 1.11 1996/05/16 05:17:14 mycroft Exp $ */
/*
@@ -139,7 +139,7 @@ struct { \
(head)->slh_first = (elm); \
} while (0)
-#define SLIST_REMOVE_NEXT(head, elm, field) do { \
+#define SLIST_REMOVE_AFTER(elm, field) do { \
(elm)->field.sle_next = (elm)->field.sle_next->field.sle_next; \
} while (0)
@@ -310,7 +310,7 @@ struct { \
(head)->sqh_last = &(head)->sqh_first; \
} while (0)
-#define SIMPLEQ_REMOVE_NEXT(head, elm, field) do { \
+#define SIMPLEQ_REMOVE_AFTER(head, elm, field) do { \
if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \
== NULL) \
(head)->sqh_last = &(elm)->field.sqe_next; \