diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-12-24 02:43:53 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2008-12-24 02:43:53 +0000 |
commit | 34ed38b118f51eae27c3119550de5b6cdc4fb3f9 (patch) | |
tree | 2ec914ba0ce8ec6bb647ed8837d91bf5073efa82 /sys/nfs | |
parent | 36c3a01e29372f8c0d28b0d3c39263f6cf2e1bca (diff) |
Replace the TRUE/FALSE defines with 1/0 respectively. This doesn't
hurt readability and it was just plain annoying seeing them defined
in every other .c file.
OK blambert@
Diffstat (limited to 'sys/nfs')
-rw-r--r-- | sys/nfs/nfs_node.c | 5 | ||||
-rw-r--r-- | sys/nfs/nfs_serv.c | 4 | ||||
-rw-r--r-- | sys/nfs/nfs_socket.c | 7 | ||||
-rw-r--r-- | sys/nfs/nfs_srvcache.c | 56 | ||||
-rw-r--r-- | sys/nfs/nfs_subs.c | 13 | ||||
-rw-r--r-- | sys/nfs/nfs_syscalls.c | 11 | ||||
-rw-r--r-- | sys/nfs/nfs_vfsops.c | 7 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 16 |
8 files changed, 31 insertions, 88 deletions
diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index 693efab846e..58040d660ad 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_node.c,v 1.43 2008/12/23 21:56:12 thib Exp $ */ +/* $OpenBSD: nfs_node.c,v 1.44 2008/12/24 02:43:52 thib Exp $ */ /* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */ /* @@ -64,9 +64,6 @@ struct pool nfs_node_pool; extern int prtactive; -#define TRUE 1 -#define FALSE 0 - #define nfs_hash(x,y) hash32_buf((x), (y), HASHINIT) /* diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c index 50a528e5d20..2f2320e6361 100644 --- a/sys/nfs/nfs_serv.c +++ b/sys/nfs/nfs_serv.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_serv.c,v 1.58 2008/07/06 16:54:48 thib Exp $ */ +/* $OpenBSD: nfs_serv.c,v 1.59 2008/12/24 02:43:52 thib Exp $ */ /* $NetBSD: nfs_serv.c,v 1.34 1997/05/12 23:37:12 fvdl Exp $ */ /* @@ -1885,7 +1885,7 @@ nfsrv_link(nfsd, slp, procp, mrq) nfsm_srvmtofh(fhp); nfsm_srvmtofh(dfhp); nfsm_srvnamesiz(len); - error = nfsrv_fhtovp(fhp, FALSE, &vp, cred, slp, nam, &rdonly); + error = nfsrv_fhtovp(fhp, 0, &vp, cred, slp, nam, &rdonly); if (error) { nfsm_reply(NFSX_POSTOPATTR(v3) + NFSX_WCCDATA(v3)); nfsm_srvpostop_attr(nfsd, getret, &at, &mb); diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c index da9bd7c7316..a2a28e33629 100644 --- a/sys/nfs/nfs_socket.c +++ b/sys/nfs/nfs_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_socket.c,v 1.70 2008/10/31 17:28:47 blambert Exp $ */ +/* $OpenBSD: nfs_socket.c,v 1.71 2008/12/24 02:43:52 thib Exp $ */ /* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */ /* @@ -69,9 +69,6 @@ #include <nfs/nfsrtt.h> #include <nfs/nfs_var.h> -#define TRUE 1 -#define FALSE 0 - /* * Estimate rto for an nfs rpc sent via. an unreliable datagram. * Use the mean and mean deviation of rtt for the appropriate type of rpc @@ -1858,7 +1855,7 @@ nfsrv_dorec(slp, nfsd, ndp) nd->nd_md = nd->nd_mrep = m; nd->nd_nam2 = nam; nd->nd_dpos = mtod(m, caddr_t); - error = nfs_getreq(nd, nfsd, TRUE); + error = nfs_getreq(nd, nfsd, 1); if (error) { m_freem(nam); free(nd, M_NFSRVDESC); diff --git a/sys/nfs/nfs_srvcache.c b/sys/nfs/nfs_srvcache.c index 26939c5af54..30d84efb614 100644 --- a/sys/nfs/nfs_srvcache.c +++ b/sys/nfs/nfs_srvcache.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_srvcache.c,v 1.20 2008/10/20 13:40:19 blambert Exp $ */ +/* $OpenBSD: nfs_srvcache.c,v 1.21 2008/12/24 02:43:52 thib Exp $ */ /* $NetBSD: nfs_srvcache.c,v 1.12 1996/02/18 11:53:49 fvdl Exp $ */ /* @@ -69,62 +69,22 @@ LIST_HEAD(nfsrvhash, nfsrvcache) *nfsrvhashtbl; TAILQ_HEAD(nfsrvlru, nfsrvcache) nfsrvlruhead; u_long nfsrvhash; -#define TRUE 1 -#define FALSE 0 - #define NETFAMILY(rp) \ (((rp)->rc_flag & RC_INETADDR) ? AF_INET : AF_UNSPEC) /* Array that defines which nfs rpc's are nonidempotent */ int nonidempotent[NFS_NPROCS] = { - FALSE, - FALSE, - TRUE, - FALSE, - FALSE, - FALSE, - FALSE, - TRUE, - TRUE, - TRUE, - TRUE, - TRUE, - TRUE, - TRUE, - TRUE, - TRUE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, + 0, 0, 1, 0, 0, 0, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0 }; /* True iff the rpc reply is an nfs status ONLY! */ int nfsv2_repstat[NFS_NPROCS] = { - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - FALSE, - TRUE, - TRUE, - TRUE, - TRUE, - FALSE, - TRUE, - FALSE, - FALSE, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 1, 1, 1, 0, 1, + 0, 0 }; /* Initialize the server request cache list */ diff --git a/sys/nfs/nfs_subs.c b/sys/nfs/nfs_subs.c index c05a624278c..bcf1a9f6dcd 100644 --- a/sys/nfs/nfs_subs.c +++ b/sys/nfs/nfs_subs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_subs.c,v 1.87 2008/11/24 20:14:52 thib Exp $ */ +/* $OpenBSD: nfs_subs.c,v 1.88 2008/12/24 02:43:52 thib Exp $ */ /* $NetBSD: nfs_subs.c,v 1.27.4.3 1996/07/08 20:34:24 jtc Exp $ */ /* @@ -925,8 +925,8 @@ nfs_init() rpc_autherr = txdr_unsigned(RPC_AUTHERR); rpc_auth_unix = txdr_unsigned(RPCAUTH_UNIX); nfs_prog = txdr_unsigned(NFS_PROG); - nfs_true = txdr_unsigned(TRUE); - nfs_false = txdr_unsigned(FALSE); + nfs_true = txdr_unsigned(1); + nfs_false = txdr_unsigned(0); nfs_xdrneg1 = txdr_unsigned(-1); nfs_ticks = (hz * NFS_TICKINTVL + 500) / 1000; if (nfs_ticks < 1) @@ -1287,7 +1287,7 @@ nfs_namei(ndp, fhp, len, slp, nam, mdp, dposp, retdirp, p) /* * Extract and set starting directory. */ - error = nfsrv_fhtovp(fhp, FALSE, &dp, ndp->ni_cnd.cn_cred, slp, + error = nfsrv_fhtovp(fhp, 0, &dp, ndp->ni_cnd.cn_cred, slp, nam, &rdonly); if (error) goto out; @@ -1557,9 +1557,8 @@ nfsrv_fhtovp(fhp, lockflag, vpp, cred, slp, nam, rdonlyp) } /* - * This function compares two net addresses by family and returns TRUE - * if they are the same host. - * If there is any doubt, return FALSE. + * This function compares two net addresses by family and returns non zero + * if they are the same host, of there is any doubt it returns 0. * The AF_INET family is handled as a special case so that address mbufs * don't need to be saved to store "struct in_addr", which is only 4 bytes. */ diff --git a/sys/nfs/nfs_syscalls.c b/sys/nfs/nfs_syscalls.c index 21e119f31c1..a6c1d4e173a 100644 --- a/sys/nfs/nfs_syscalls.c +++ b/sys/nfs/nfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_syscalls.c,v 1.72 2008/09/12 15:41:40 thib Exp $ */ +/* $OpenBSD: nfs_syscalls.c,v 1.73 2008/12/24 02:43:52 thib Exp $ */ /* $NetBSD: nfs_syscalls.c,v 1.19 1996/02/18 11:53:52 fvdl Exp $ */ /* @@ -121,9 +121,6 @@ struct nfsdhead nfsd_head; int nfssvc_sockhead_flag; int nfsd_head_flag; -#define TRUE 1 -#define FALSE 0 - #ifdef NFSCLIENT struct proc *nfs_asyncdaemon[NFS_MAXASYNCDAEMON]; int nfs_niothreads = -1; @@ -440,13 +437,13 @@ nfssvc_nfsd(nsd, argp, p) } if (error) { nfsstats.srv_errs++; - nfsrv_updatecache(nd, FALSE, mreq); + nfsrv_updatecache(nd, 0, mreq); if (nd->nd_nam2) m_freem(nd->nd_nam2); break; } nfsstats.srvrpccnt[nd->nd_procnum]++; - nfsrv_updatecache(nd, TRUE, mreq); + nfsrv_updatecache(nd, 1, mreq); nd->nd_mrep = (struct mbuf *)0; /* FALLTHROUGH */ @@ -538,7 +535,7 @@ done: free((caddr_t)nfsd, M_NFSD); nsd->nsd_nfsd = (struct nfsd *)0; if (--nfs_numnfsd == 0) - nfsrv_init(TRUE); /* Reinitialize everything */ + nfsrv_init(1); /* Reinitialize everything */ return (error); } diff --git a/sys/nfs/nfs_vfsops.c b/sys/nfs/nfs_vfsops.c index 6361b90bb23..98fb5342c82 100644 --- a/sys/nfs/nfs_vfsops.c +++ b/sys/nfs/nfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vfsops.c,v 1.79 2008/07/28 13:35:14 thib Exp $ */ +/* $OpenBSD: nfs_vfsops.c,v 1.80 2008/12/24 02:43:52 thib Exp $ */ /* $NetBSD: nfs_vfsops.c,v 1.46.4.1 1996/05/25 22:40:35 fvdl Exp $ */ /* @@ -97,9 +97,6 @@ const struct vfsops nfs_vfsops = { nfs_checkexp }; -#define TRUE 1 -#define FALSE 0 - /* * nfs statfs call */ @@ -611,7 +608,7 @@ nfs_mount(mp, path, data, ndp, p) if (nfs_niothreads < 0) { nfs_niothreads = 4; - nfs_getset_niothreads(TRUE); + nfs_getset_niothreads(1); } if (mp->mnt_flag & MNT_UPDATE) { diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 2411f6c0858..87489a70b8e 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.104 2008/10/16 07:57:06 blambert Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.105 2008/12/24 02:43:52 thib Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -79,10 +79,6 @@ #include <netinet/in.h> #include <netinet/in_var.h> -/* Defs */ -#define TRUE 1 -#define FALSE 0 - void nfs_cache_enter(struct vnode *, struct vnode *, struct componentname *); /* @@ -623,7 +619,7 @@ nfs_setattrrpc(vp, vap, cred, procp) mb = mreq = nfsm_reqhead(NFSX_FH(v3) + NFSX_SATTR(v3)); nfsm_fhtom(vp, v3); if (v3) { - nfsm_v3attrbuild(&mb, vap, TRUE); + nfsm_v3attrbuild(&mb, vap, 1); tl = nfsm_build(&mb, NFSX_UNSIGNED); *tl = nfs_false; } else { @@ -1182,7 +1178,7 @@ nfs_mknodrpc(dvp, vpp, cnp, vap) if (v3) { tl = nfsm_build(&mb, NFSX_UNSIGNED); *tl++ = vtonfsv3_type(vap->va_type); - nfsm_v3attrbuild(&mb, vap, FALSE); + nfsm_v3attrbuild(&mb, vap, 0); if (vap->va_type == VCHR || vap->va_type == VBLK) { tl = nfsm_build(&mb, 2 * NFSX_UNSIGNED); *tl++ = txdr_unsigned(major(vap->va_rdev)); @@ -1302,7 +1298,7 @@ again: *tl = ++create_verf; } else { *tl = txdr_unsigned(NFSV3CREATE_UNCHECKED); - nfsm_v3attrbuild(&mb, vap, FALSE); + nfsm_v3attrbuild(&mb, vap, 0); } } else { sp = nfsm_build(&mb, NFSX_V2SATTR); @@ -1685,7 +1681,7 @@ nfs_symlink(v) nfsm_fhtom(dvp, v3); nfsm_strtom(cnp->cn_nameptr, cnp->cn_namelen, NFS_MAXNAMLEN); if (v3) - nfsm_v3attrbuild(&mb, vap, FALSE); + nfsm_v3attrbuild(&mb, vap, 0); nfsm_strtom(ap->a_target, slen, NFS_MAXPATHLEN); if (!v3) { sp = nfsm_build(&mb, NFSX_V2SATTR); @@ -1745,7 +1741,7 @@ nfs_mkdir(v) nfsm_fhtom(dvp, v3); nfsm_strtom(cnp->cn_nameptr, len, NFS_MAXNAMLEN); if (v3) { - nfsm_v3attrbuild(&mb, vap, FALSE); + nfsm_v3attrbuild(&mb, vap, 0); } else { sp = nfsm_build(&mb, NFSX_V2SATTR); sp->sa_mode = vtonfsv2_mode(VDIR, vap->va_mode); |