diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2008-06-11 04:52:28 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2008-06-11 04:52:28 +0000 |
commit | d5fd8ef27566a1cc60baba9cf6624cc6e82098b7 (patch) | |
tree | 707b59d209d9d71dd13f5f615e37d108ce76106f | |
parent | 756bea63ce1503e31fa7dd33982153bc7c867b83 (diff) |
Canonical for() -> queue.h FOREACH macro conversions.
Also, it is historical practice to #include <sys/queue.h>
when using queue.h macros.
ok thib@ krw@
special thanks to krw@ for reminders vice violence
-rw-r--r-- | sys/nfs/nfs_bio.c | 3 | ||||
-rw-r--r-- | sys/nfs/nfs_boot.c | 6 | ||||
-rw-r--r-- | sys/nfs/nfs_kq.c | 3 | ||||
-rw-r--r-- | sys/nfs/nfs_node.c | 5 | ||||
-rw-r--r-- | sys/nfs/nfs_serv.c | 3 | ||||
-rw-r--r-- | sys/nfs/nfs_socket.c | 6 | ||||
-rw-r--r-- | sys/nfs/nfs_srvcache.c | 3 | ||||
-rw-r--r-- | sys/nfs/nfs_syscalls.c | 9 | ||||
-rw-r--r-- | sys/nfs/nfs_vfsops.c | 6 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 3 |
10 files changed, 26 insertions, 21 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c index a5246920371..446b097a528 100644 --- a/sys/nfs/nfs_bio.c +++ b/sys/nfs/nfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_bio.c,v 1.46 2007/06/01 23:47:57 deraadt Exp $ */ +/* $OpenBSD: nfs_bio.c,v 1.47 2008/06/11 04:52:27 blambert Exp $ */ /* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */ /* @@ -45,6 +45,7 @@ #include <sys/mount.h> #include <sys/kernel.h> #include <sys/namei.h> +#include <sys/queue.h> #include <uvm/uvm_extern.h> diff --git a/sys/nfs/nfs_boot.c b/sys/nfs/nfs_boot.c index 22d017c2ff4..f0bb778b332 100644 --- a/sys/nfs/nfs_boot.c +++ b/sys/nfs/nfs_boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_boot.c,v 1.23 2008/05/27 04:30:50 deraadt Exp $ */ +/* $OpenBSD: nfs_boot.c,v 1.24 2008/06/11 04:52:27 blambert Exp $ */ /* $NetBSD: nfs_boot.c,v 1.26 1996/05/07 02:51:25 thorpej Exp $ */ /* @@ -39,6 +39,7 @@ #include <sys/reboot.h> #include <sys/socket.h> #include <sys/socketvar.h> +#include <sys/queue.h> #include <net/if.h> #include <net/route.h> @@ -142,8 +143,7 @@ nfs_boot_init(nd, procp) if (nfsbootdevname) ifp = ifunit(nfsbootdevname); else { - for (ifp = TAILQ_FIRST(&ifnet); ifp != NULL; - ifp = TAILQ_NEXT(ifp, if_list)) { + TAILQ_FOREACH(ifp, &ifnet, if_list) { if ((ifp->if_flags & (IFF_LOOPBACK|IFF_POINTOPOINT)) == 0) break; diff --git a/sys/nfs/nfs_kq.c b/sys/nfs/nfs_kq.c index c2ecfb35d22..e1ac300fac8 100644 --- a/sys/nfs/nfs_kq.c +++ b/sys/nfs/nfs_kq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_kq.c,v 1.10 2007/09/20 12:54:31 thib Exp $ */ +/* $OpenBSD: nfs_kq.c,v 1.11 2008/06/11 04:52:27 blambert Exp $ */ /* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */ /*- @@ -50,6 +50,7 @@ #include <sys/file.h> #include <sys/kthread.h> #include <sys/rwlock.h> +#include <sys/queue.h> #include <uvm/uvm_extern.h> #include <uvm/uvm.h> diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index 26af6c2ceea..c14d6717138 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_node.c,v 1.38 2008/06/10 22:59:09 thib Exp $ */ +/* $OpenBSD: nfs_node.c,v 1.39 2008/06/11 04:52:27 blambert Exp $ */ /* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */ /* @@ -47,6 +47,7 @@ #include <sys/pool.h> #include <sys/hash.h> #include <sys/rwlock.h> +#include <sys/queue.h> #include <nfs/rpcv2.h> #include <nfs/nfsproto.h> @@ -103,7 +104,7 @@ nfs_nget(mntp, fhp, fhsize, npp) nhpp = NFSNOHASH(nfs_hash(fhp, fhsize)); loop: - for (np = LIST_FIRST(nhpp); np != NULL; np = LIST_NEXT(np, n_hash)) { + LIST_FOREACH(np, nhpp, n_hash) { if (mntp != NFSTOV(np)->v_mount || np->n_fhsize != fhsize || bcmp((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize)) continue; diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index c77c054d7ac..6145f253c96 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_serv.c,v 1.51 2008/05/27 19:06:28 blambert Exp $ */ +/* $OpenBSD: nfs_serv.c,v 1.52 2008/06/11 04:52:27 blambert Exp $ */ /* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */ /* @@ -69,6 +69,7 @@ #include <sys/stat.h> #include <sys/kernel.h> #include <sys/pool.h> +#include <sys/queue.h> #include <ufs/ufs/dir.h> #include <uvm/uvm_extern.h> diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index 0eb9633b4e1..0380d3e0cca 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_socket.c,v 1.59 2008/05/23 15:51:12 thib Exp $ */ +/* $OpenBSD: nfs_socket.c,v 1.60 2008/06/11 04:52:27 blambert Exp $ */ /* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */ /* @@ -54,6 +54,7 @@ #include <sys/tprintf.h> #include <sys/namei.h> #include <sys/pool.h> +#include <sys/queue.h> #include <netinet/in.h> #include <netinet/tcp.h> @@ -725,8 +726,7 @@ nfsmout: * Loop through the request list to match up the reply * Iff no match, just drop the datagram */ - for (rep = TAILQ_FIRST(&nfs_reqq); rep != NULL; - rep = TAILQ_NEXT(rep, r_chain)) { + TAILQ_FOREACH(rep, &nfs_reqq, r_chain) { if (rep->r_mrep == NULL && rxid == rep->r_xid) { /* Found it.. */ rep->r_mrep = mrep; diff --git a/sys/nfs/nfs_srvcache.c b/sys/nfs/nfs_srvcache.c index 8d64e7cd1a7..b4d637a728b 100644 --- a/sys/nfs/nfs_srvcache.c +++ b/sys/nfs/nfs_srvcache.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_srvcache.c,v 1.16 2008/04/14 10:39:19 thib Exp $ */ +/* $OpenBSD: nfs_srvcache.c,v 1.17 2008/06/11 04:52:27 blambert Exp $ */ /* $NetBSD: nfs_srvcache.c,v 1.12 1996/02/18 11:53:49 fvdl Exp $ */ /* @@ -48,6 +48,7 @@ #include <sys/mbuf.h> #include <sys/malloc.h> #include <sys/socket.h> +#include <sys/queue.h> #include <netinet/in.h> #include <nfs/rpcv2.h> diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index 27a6c7b5be9..caedf7bdc5c 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_syscalls.c,v 1.61 2008/06/11 00:44:53 thib Exp $ */ +/* $OpenBSD: nfs_syscalls.c,v 1.62 2008/06/11 04:52:27 blambert Exp $ */ /* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */ /* @@ -56,6 +56,7 @@ #include <sys/filedesc.h> #include <sys/signalvar.h> #include <sys/kthread.h> +#include <sys/queue.h> #include <sys/syscallargs.h> @@ -321,8 +322,7 @@ nfssvc_nfsd(nsd, argp, p) } if (nfsd->nfsd_slp == NULL && (nfsd_head_flag & NFSD_CHECKSLP) != 0) { - for (slp = TAILQ_FIRST(&nfssvc_sockhead); - slp != 0; slp = TAILQ_NEXT(slp, ns_chain)) { + TAILQ_FOREACH(slp, &nfssvc_sockhead, ns_chain) { if ((slp->ns_flag & (SLP_VALID | SLP_DOREC)) == (SLP_VALID | SLP_DOREC)) { slp->ns_flag &= ~SLP_DOREC; @@ -741,8 +741,7 @@ nfssvc_iod(p) */ vp = bp->b_vp; s = splbio(); - for (nbp = LIST_FIRST(&vp->v_dirtyblkhd); nbp != NULL; - nbp = LIST_NEXT(nbp, b_vnbufs)) { + LIST_FOREACH(nbp, &vp->v_dirtyblkhd, b_vnbufs) { if ((nbp->b_flags & (B_BUSY|B_DELWRI|B_NEEDCOMMIT|B_NOCACHE))!=B_DELWRI) continue; diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index e00e08380ea..bed19e20aac 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vfsops.c,v 1.72 2008/04/25 12:33:41 blambert Exp $ */ +/* $OpenBSD: nfs_vfsops.c,v 1.73 2008/06/11 04:52:27 blambert Exp $ */ /* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */ /* @@ -51,6 +51,7 @@ #include <sys/socketvar.h> #include <sys/systm.h> #include <sys/sysctl.h> +#include <sys/queue.h> #include <net/if.h> #include <net/route.h> @@ -795,8 +796,7 @@ nfs_sync(mp, waitfor, cred, p) * Force stale buffer cache information to be flushed. */ loop: - for (vp = LIST_FIRST(&mp->mnt_vnodelist); vp != NULL; - vp = LIST_NEXT(vp, v_mntvnodes)) { + LIST_FOREACH(vp, &mp->mnt_vnodelist, v_mntvnodes) { /* * If the vnode that we are about to sync is no longer * associated with this mount point, start over. diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 0c2806acedd..189f16f1e2b 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.86 2008/06/10 22:59:09 thib Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.87 2008/06/11 04:52:27 blambert Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -59,6 +59,7 @@ #include <sys/fcntl.h> #include <sys/lockf.h> #include <sys/hash.h> +#include <sys/queue.h> #include <uvm/uvm_extern.h> |