summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-03-05 21:48:58 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-03-05 21:48:58 +0000
commit52f635294dc2220b27898d3db1703c9464b92fb1 (patch)
tree5c2d6cca90a4bcc953c4c704201e7c2d7c08188e /sys/compat
parent84fa77ca902d7934ca42a7fdd806497b643a8421 (diff)
Use more queue macros rather than doing it by hand; ok otto@ krw@
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/common/vfs_syscalls_25.c4
-rw-r--r--sys/compat/freebsd/freebsd_file.c11
-rw-r--r--sys/compat/linux/linux_socket.c8
-rw-r--r--sys/compat/netbsd/netbsd_file.c11
-rw-r--r--sys/compat/osf1/osf1_mount.c7
-rw-r--r--sys/compat/svr4/svr4_misc.c6
-rw-r--r--sys/compat/svr4/svr4_socket.c6
-rw-r--r--sys/compat/svr4/svr4_sockio.c11
-rw-r--r--sys/compat/ultrix/ultrix_fs.c14
9 files changed, 39 insertions, 39 deletions
diff --git a/sys/compat/common/vfs_syscalls_25.c b/sys/compat/common/vfs_syscalls_25.c
index 77f65ff4da4..333724e87e7 100644
--- a/sys/compat/common/vfs_syscalls_25.c
+++ b/sys/compat/common/vfs_syscalls_25.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls_25.c,v 1.7 2005/11/30 10:35:07 pedro Exp $ */
+/* $OpenBSD: vfs_syscalls_25.c,v 1.8 2006/03/05 21:48:54 miod Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -195,7 +195,7 @@ compat_25_sys_getfsstat(p, v, retval)
flags == 0) &&
(error = VFS_STATFS(mp, sp, p))) {
simple_lock(&mountlist_slock);
- nmp = mp->mnt_list.cqe_next;
+ nmp = CIRCLEQ_NEXT(mp, mnt_list);
vfs_unbusy(mp);
continue;
}
diff --git a/sys/compat/freebsd/freebsd_file.c b/sys/compat/freebsd/freebsd_file.c
index 1cbc83c40fd..f78a599f5e9 100644
--- a/sys/compat/freebsd/freebsd_file.c
+++ b/sys/compat/freebsd/freebsd_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: freebsd_file.c,v 1.20 2005/11/30 10:35:07 pedro Exp $ */
+/* $OpenBSD: freebsd_file.c,v 1.21 2006/03/05 21:48:56 miod Exp $ */
/* $NetBSD: freebsd_file.c,v 1.3 1996/05/03 17:03:09 christos Exp $ */
/*
@@ -658,9 +658,10 @@ freebsd_sys_getfsstat(p, v, retval)
sfsp = (caddr_t)SCARG(uap, buf);
count = 0;
simple_lock(&mountlist_slock);
- for (mp = mountlist.cqh_first; mp != (void *)&mountlist; mp = nmp) {
+ for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist);
+ mp = nmp) {
if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock)) {
- nmp = mp->mnt_list.cqe_next;
+ nmp = CIRCLEQ_NEXT(mp, mnt_list);
continue;
}
if (sfsp && count < maxcount) {
@@ -673,7 +674,7 @@ freebsd_sys_getfsstat(p, v, retval)
flags == 0) &&
(error = VFS_STATFS(mp, sp, p))) {
simple_lock(&mountlist_slock);
- nmp = mp->mnt_list.cqe_next;
+ nmp = CIRCLEQ_NEXT(mp, mnt_list);
vfs_unbusy(mp);
continue;
}
@@ -689,7 +690,7 @@ freebsd_sys_getfsstat(p, v, retval)
}
count++;
simple_lock(&mountlist_slock);
- nmp = mp->mnt_list.cqe_next;
+ nmp = CIRCLEQ_NEXT(mp, mnt_list);
vfs_unbusy(mp);
}
simple_unlock(&mountlist_slock);
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index 9811ff3fe93..976757a5c5c 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_socket.c,v 1.34 2005/11/21 18:16:37 millert Exp $ */
+/* $OpenBSD: linux_socket.c,v 1.35 2006/03/05 21:48:56 miod Exp $ */
/* $NetBSD: linux_socket.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */
/*
@@ -1418,12 +1418,10 @@ linux_ioctl_socket(p, v, retval)
* Note that we don't actually respect the name in the ifreq
* structure, as Linux interface names are all different.
*/
- for (ifp = ifnet.tqh_first; ifp != 0;
- ifp = ifp->if_list.tqe_next) {
+ TAILQ_FOREACH(ifp, &ifnet, if_list) {
if (ifp->if_type != IFT_ETHER)
continue;
- for (ifa = ifp->if_addrlist.tqh_first; ifa;
- ifa = ifa->ifa_list.tqe_next) {
+ TAILQ_FOREACH(ifa, &ifp->if_addrlist, ifa_list) {
if ((sdl = (struct sockaddr_dl *)ifa->ifa_addr) &&
(sdl->sdl_family == AF_LINK) &&
(sdl->sdl_type == IFT_ETHER)) {
diff --git a/sys/compat/netbsd/netbsd_file.c b/sys/compat/netbsd/netbsd_file.c
index 0c8c8ee252f..47e7e326f4f 100644
--- a/sys/compat/netbsd/netbsd_file.c
+++ b/sys/compat/netbsd/netbsd_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netbsd_file.c,v 1.6 2005/11/30 10:35:07 pedro Exp $ */
+/* $OpenBSD: netbsd_file.c,v 1.7 2006/03/05 21:48:56 miod Exp $ */
/* $NetBSD: freebsd_file.c,v 1.3 1996/05/03 17:03:09 christos Exp $ */
/*
@@ -632,9 +632,10 @@ netbsd_sys_getfsstat(p, v, retval)
sfsp = (caddr_t)SCARG(uap, buf);
count = 0;
simple_lock(&mountlist_slock);
- for (mp = mountlist.cqh_first; mp != (void *)&mountlist; mp = nmp) {
+ for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist);
+ mp = nmp) {
if (vfs_busy(mp, LK_NOWAIT, &mountlist_slock)) {
- nmp = mp->mnt_list.cqe_next;
+ nmp = CIRCLEQ_NEXT(mp, mnt_list);
continue;
}
if (sfsp && count < maxcount) {
@@ -647,7 +648,7 @@ netbsd_sys_getfsstat(p, v, retval)
flags == 0) &&
(error = VFS_STATFS(mp, sp, p))) {
simple_lock(&mountlist_slock);
- nmp = mp->mnt_list.cqe_next;
+ nmp = CIRCLEQ_NEXT(mp, mnt_list);
vfs_unbusy(mp);
continue;
}
@@ -663,7 +664,7 @@ netbsd_sys_getfsstat(p, v, retval)
}
count++;
simple_lock(&mountlist_slock);
- nmp = mp->mnt_list.cqe_next;
+ nmp = CIRCLEQ_NEXT(mp, mnt_list);
vfs_unbusy(mp);
}
simple_unlock(&mountlist_slock);
diff --git a/sys/compat/osf1/osf1_mount.c b/sys/compat/osf1/osf1_mount.c
index e0d8dd1f57f..221c760d35b 100644
--- a/sys/compat/osf1/osf1_mount.c
+++ b/sys/compat/osf1/osf1_mount.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: osf1_mount.c,v 1.10 2005/07/03 20:13:59 drahn Exp $ */
+/* $OpenBSD: osf1_mount.c,v 1.11 2006/03/05 21:48:56 miod Exp $ */
/* $NetBSD: osf1_mount.c,v 1.14 1999/05/05 01:51:34 cgd Exp $ */
/*
@@ -151,9 +151,10 @@ osf1_sys_getfsstat(p, v, retval)
maxcount = SCARG(uap, bufsize) / sizeof(struct osf1_statfs);
osf_sfsp = (caddr_t)SCARG(uap, buf);
- for (count = 0, mp = mountlist.cqh_first; mp != (void *)&mountlist;
+ count = 0;
+ for (mp = CIRCLEQ_FIRST(&mountlist); mp != CIRCLEQ_END(&mountlist);
mp = nmp) {
- nmp = mp->mnt_list.cqe_next;
+ nmp = CIRCLEQ_NEXT(mp, mnt_list);
if (osf_sfsp && count < maxcount) {
sp = &mp->mnt_stat;
/*
diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c
index f02c0a925b7..4ff7d6c653f 100644
--- a/sys/compat/svr4/svr4_misc.c
+++ b/sys/compat/svr4/svr4_misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svr4_misc.c,v 1.44 2004/06/22 23:52:18 jfb Exp $ */
+/* $OpenBSD: svr4_misc.c,v 1.45 2006/03/05 21:48:56 miod Exp $ */
/* $NetBSD: svr4_misc.c,v 1.42 1996/12/06 03:22:34 christos Exp $ */
/*
@@ -824,7 +824,7 @@ svr4_pfind(pid)
return p;
/* look in the zombies */
- for (p = zombproc.lh_first; p != 0; p = p->p_list.le_next)
+ LIST_FOREACH(p, &zombproc, p_list)
if (p->p_pid == pid)
return p;
@@ -1063,7 +1063,7 @@ svr4_sys_waitsys(q, v, retval)
loop:
nfound = 0;
- for (p = q->p_children.lh_first; p != 0; p = p->p_sibling.le_next) {
+ LIST_FOREACH(p, &q->p_children, p_sibling) {
if (SCARG(uap, id) != WAIT_ANY &&
p->p_pid != SCARG(uap, id) &&
p->p_pgid != -SCARG(uap, id)) {
diff --git a/sys/compat/svr4/svr4_socket.c b/sys/compat/svr4/svr4_socket.c
index 4eb3055647f..fab78137b58 100644
--- a/sys/compat/svr4/svr4_socket.c
+++ b/sys/compat/svr4/svr4_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svr4_socket.c,v 1.4 2002/04/25 21:01:41 espie Exp $ */
+/* $OpenBSD: svr4_socket.c,v 1.5 2006/03/05 21:48:56 miod Exp $ */
/* $NetBSD: svr4_socket.c,v 1.4 1997/07/21 23:02:37 christos Exp $ */
/*
@@ -93,7 +93,7 @@ svr4_find_socket(p, fp, dev, ino)
DPRINTF(("svr4_find_socket: [%p,%d,%d]: ", p, dev, ino));
- for (e = svr4_head.tqh_first; e != NULL; e = e->entries.tqe_next)
+ TAILQ_FOREACH(e, &svr4_head, entries)
if (e->p == p && e->dev == dev && e->ino == ino) {
#ifdef DIAGNOSTIC
if (e->cookie != NULL && e->cookie != cookie)
@@ -123,7 +123,7 @@ svr4_delete_socket(p, fp)
return;
}
- for (e = svr4_head.tqh_first; e != NULL; e = e->entries.tqe_next)
+ TAILQ_FOREACH(e, &svr4_head, entries)
if (e->p == p && e->cookie == cookie) {
TAILQ_REMOVE(&svr4_head, e, entries);
DPRINTF(("svr4_delete_socket: %s [%p,%d,%d]\n",
diff --git a/sys/compat/svr4/svr4_sockio.c b/sys/compat/svr4/svr4_sockio.c
index 57f51d512ad..f814c312d6e 100644
--- a/sys/compat/svr4/svr4_sockio.c
+++ b/sys/compat/svr4/svr4_sockio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: svr4_sockio.c,v 1.9 2004/06/22 23:52:18 jfb Exp $ */
+/* $OpenBSD: svr4_sockio.c,v 1.10 2006/03/05 21:48:56 miod Exp $ */
/* $NetBSD: svr4_sockio.c,v 1.10 1996/05/03 17:09:15 christos Exp $ */
/*
@@ -109,13 +109,12 @@ svr4_sock_ioctl(fp, p, retval, fd, cmd, data)
* entry per physical interface?
*/
- for (ifp = ifnet.tqh_first;
- ifp != 0; ifp = ifp->if_list.tqe_next)
- if ((ifa = ifp->if_addrlist.tqh_first) == NULL)
+ TAILQ_FOREACH(ifp, &ifnet, if_list)
+ if (TAILQ_EMPTY(&ifp->if_addrlist))
ifnum++;
else
- for (;ifa != NULL;
- ifa = ifa->ifa_list.tqe_next)
+ TAILQ_FOREACH(ifa, &ifp->if_addrlist,
+ ifa_list)
ifnum++;
diff --git a/sys/compat/ultrix/ultrix_fs.c b/sys/compat/ultrix/ultrix_fs.c
index 63a21c47fd4..6cacd7bd561 100644
--- a/sys/compat/ultrix/ultrix_fs.c
+++ b/sys/compat/ultrix/ultrix_fs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ultrix_fs.c,v 1.13 2005/12/10 11:45:43 miod Exp $ */
+/* $OpenBSD: ultrix_fs.c,v 1.14 2006/03/05 21:48:56 miod Exp $ */
/* $NetBSD: ultrix_fs.c,v 1.4 1996/04/07 17:23:06 jonathan Exp $ */
/*
@@ -237,14 +237,14 @@ ultrix_sys_getmnt(p, v, retval)
if ((error = copyin((caddr_t)SCARG(uap, start), &start,
sizeof(*SCARG(uap, start)))) != 0)
goto bad;
- for (skip = start, mp = mountlist.cqh_first;
- mp != (void *)&mountlist && skip-- > 0; mp = nmp)
- nmp = mp->mnt_list.cqe_next;
+ for (skip = start, mp = CIRCLEQ_FIRST(&mountlist);
+ mp != CIRCLEQ_END(&mountlist) && skip-- > 0; mp = nmp)
+ nmp = CIRCLEQ_NEXT(mp, mnt_list);
}
- for (count = 0, mp = mountlist.cqh_first;
- mp != (void *)&mountlist && count < maxcount; mp = nmp) {
- nmp = mp->mnt_list.cqe_next;
+ for (count = 0, mp = CIRCLEQ_FIRST(&mountlist);
+ mp != CIRCLEQ_END(&mountlist) && count < maxcount; mp = nmp) {
+ nmp = CIRCLEQ_NEXT(mp, mnt_list);
if (sfsp != NULL) {
struct ultrix_fs_data tem;
sp = &mp->mnt_stat;