summaryrefslogtreecommitdiffstats
path: root/sys/nfsserver
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2002-01-08 19:41:06 +0000
committermsmith <msmith@FreeBSD.org>2002-01-08 19:41:06 +0000
commit7f06d73491446372d0b659886c6da537a5e67bc0 (patch)
tree475ccd5e68c8b58f75161b23c9c51920fe7bc876 /sys/nfsserver
parentcb52de758f82c925fb6321f89fe6af8a6c1b83bb (diff)
downloadFreeBSD-src-7f06d73491446372d0b659886c6da537a5e67bc0.zip
FreeBSD-src-7f06d73491446372d0b659886c6da537a5e67bc0.tar.gz
Rename some variables that end up shadowing their namesakes in the NFS client
code. Reviewed by: peter
Diffstat (limited to 'sys/nfsserver')
-rw-r--r--sys/nfsserver/nfs.h13
-rw-r--r--sys/nfsserver/nfs_serv.c48
-rw-r--r--sys/nfsserver/nfs_srvsock.c22
-rw-r--r--sys/nfsserver/nfs_srvsubs.c61
-rw-r--r--sys/nfsserver/nfs_syscalls.c3
5 files changed, 74 insertions, 73 deletions
diff --git a/sys/nfsserver/nfs.h b/sys/nfsserver/nfs.h
index 610201b..25ab85d 100644
--- a/sys/nfsserver/nfs.h
+++ b/sys/nfsserver/nfs.h
@@ -158,18 +158,21 @@ struct nameidata;
extern struct callout_handle nfsrv_timer_handle;
extern struct nfsrvstats nfsrvstats;
-extern int nfs_ticks;
+extern int nfsrv_ticks;
extern int nfsrvw_procrastinate;
extern int nfsrvw_procrastinate_v3;
/* Various values converted to XDR form. */
-extern u_int32_t nfs_false, nfs_true, nfs_xdrneg1, nfs_prog;
-extern u_int32_t rpc_reply, rpc_msgdenied, rpc_mismatch, rpc_vers;
-extern u_int32_t rpc_auth_unix, rpc_msgaccepted, rpc_call, rpc_autherr;
+extern u_int32_t nfsrv_nfs_false, nfsrv_nfs_true, nfsrv_nfs_xdrneg1,
+ nfsrv_nfs_prog;
+extern u_int32_t nfsrv_rpc_reply, nfsrv_rpc_msgdenied, nfsrv_rpc_mismatch,
+ nfsrv_rpc_vers;
+extern u_int32_t nfsrv_rpc_auth_unix, nfsrv_rpc_msgaccepted, nfsrv_rpc_call,
+ nfsrv_rpc_autherr;
/* Procedure table data */
extern int nfsrvv2_procid[NFS_NPROCS];
-extern int nfsv3_procid[NFS_NPROCS];
+extern int nfsrv_nfsv3_procid[NFS_NPROCS];
extern int32_t (*nfsrv3_procs[NFS_NPROCS])(struct nfsrv_descript *nd,
struct nfssvc_sock *slp, struct thread *td,
struct mbuf **mreqp);
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 9452fcd..770bc09 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -336,13 +336,13 @@ nfsrv_setattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
*/
if ((fxdr_unsigned(int, sp->sa_mode) & 0xffff) != 0xffff)
vap->va_mode = nfstov_mode(sp->sa_mode);
- if (sp->sa_uid != nfs_xdrneg1)
+ if (sp->sa_uid != nfsrv_nfs_xdrneg1)
vap->va_uid = fxdr_unsigned(uid_t, sp->sa_uid);
- if (sp->sa_gid != nfs_xdrneg1)
+ if (sp->sa_gid != nfsrv_nfs_xdrneg1)
vap->va_gid = fxdr_unsigned(gid_t, sp->sa_gid);
- if (sp->sa_size != nfs_xdrneg1)
+ if (sp->sa_size != nfsrv_nfs_xdrneg1)
vap->va_size = fxdr_unsigned(u_quad_t, sp->sa_size);
- if (sp->sa_atime.nfsv2_sec != nfs_xdrneg1) {
+ if (sp->sa_atime.nfsv2_sec != nfsrv_nfs_xdrneg1) {
#ifdef notyet
fxdr_nfsv2time(&sp->sa_atime, &vap->va_atime);
#else
@@ -351,7 +351,7 @@ nfsrv_setattr(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
vap->va_atime.tv_nsec = 0;
#endif
}
- if (sp->sa_mtime.nfsv2_sec != nfs_xdrneg1)
+ if (sp->sa_mtime.nfsv2_sec != nfsrv_nfs_xdrneg1)
fxdr_nfsv2time(&sp->sa_mtime, &vap->va_mtime);
}
@@ -878,7 +878,7 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
nfsm_reply(NFSX_POSTOPORFATTR(v3) + 3 * NFSX_UNSIGNED+nfsm_rndup(cnt));
if (v3) {
tl = nfsm_build(u_int32_t *, NFSX_V3FATTR + 4 * NFSX_UNSIGNED);
- *tl++ = nfs_true;
+ *tl++ = nfsrv_nfs_true;
fp = (struct nfs_fattr *)tl;
tl += (NFSX_V3FATTR / sizeof (u_int32_t));
} else {
@@ -962,9 +962,9 @@ nfsrv_read(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
if (v3) {
*tl++ = txdr_unsigned(cnt);
if (len < reqlen)
- *tl++ = nfs_true;
+ *tl++ = nfsrv_nfs_true;
else
- *tl++ = nfs_false;
+ *tl++ = nfsrv_nfs_false;
}
*tl = txdr_unsigned(cnt);
nfsmout:
@@ -3113,8 +3113,8 @@ again:
tl += 2;
} else
tl = nfsm_build(u_int32_t *, 2 * NFSX_UNSIGNED);
- *tl++ = nfs_false;
- *tl = nfs_true;
+ *tl++ = nfsrv_nfs_false;
+ *tl = nfsrv_nfs_true;
FREE((caddr_t)rbuf, M_TEMP);
FREE((caddr_t)cookies, M_TEMP);
error = 0;
@@ -3179,7 +3179,7 @@ again:
* the dirent entry.
*/
nfsm_clget;
- *tl = nfs_true;
+ *tl = nfsrv_nfs_true;
bp += NFSX_UNSIGNED;
if (v3) {
nfsm_clget;
@@ -3230,13 +3230,13 @@ again:
vrele(vp);
vp = NULL;
nfsm_clget;
- *tl = nfs_false;
+ *tl = nfsrv_nfs_false;
bp += NFSX_UNSIGNED;
nfsm_clget;
if (eofflag)
- *tl = nfs_true;
+ *tl = nfsrv_nfs_true;
else
- *tl = nfs_false;
+ *tl = nfsrv_nfs_false;
bp += NFSX_UNSIGNED;
if (mp != mb) {
if (bp < be)
@@ -3383,8 +3383,8 @@ again:
tl = nfsm_build(u_int32_t *, 4 * NFSX_UNSIGNED);
txdr_hyper(at.va_filerev, tl);
tl += 2;
- *tl++ = nfs_false;
- *tl = nfs_true;
+ *tl++ = nfsrv_nfs_false;
+ *tl = nfsrv_nfs_true;
FREE((caddr_t)cookies, M_TEMP);
FREE((caddr_t)rbuf, M_TEMP);
error = 0;
@@ -3498,13 +3498,13 @@ again:
fp = (struct nfs_fattr *)&fl.fl_fattr;
nfsm_srvfillattr(vap, fp);
fl.fl_fhsize = txdr_unsigned(NFSX_V3FH);
- fl.fl_fhok = nfs_true;
- fl.fl_postopok = nfs_true;
+ fl.fl_fhok = nfsrv_nfs_true;
+ fl.fl_postopok = nfsrv_nfs_true;
fl.fl_off.nfsuquad[0] = 0;
fl.fl_off.nfsuquad[1] = txdr_unsigned(*cookiep);
nfsm_clget;
- *tl = nfs_true;
+ *tl = nfsrv_nfs_true;
bp += NFSX_UNSIGNED;
nfsm_clget;
*tl = 0;
@@ -3562,13 +3562,13 @@ invalid:
vrele(vp);
vp = NULL;
nfsm_clget;
- *tl = nfs_false;
+ *tl = nfsrv_nfs_false;
bp += NFSX_UNSIGNED;
nfsm_clget;
if (eofflag)
- *tl = nfs_true;
+ *tl = nfsrv_nfs_true;
else
- *tl = nfs_false;
+ *tl = nfsrv_nfs_false;
bp += NFSX_UNSIGNED;
if (mp != mb) {
if (bp < be)
@@ -3943,8 +3943,8 @@ nfsrv_pathconf(struct nfsrv_descript *nfsd, struct nfssvc_sock *slp,
* until msdosfs is exportable (why would you want to?), the
* Unix defaults should be ok.
*/
- pc->pc_caseinsensitive = nfs_false;
- pc->pc_casepreserving = nfs_true;
+ pc->pc_caseinsensitive = nfsrv_nfs_false;
+ pc->pc_casepreserving = nfsrv_nfs_true;
nfsmout:
if (vp)
vput(vp);
diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c
index 2b59434..7091c82 100644
--- a/sys/nfsserver/nfs_srvsock.c
+++ b/sys/nfsserver/nfs_srvsock.c
@@ -163,21 +163,21 @@ nfs_rephead(int siz, struct nfsrv_descript *nd, int err,
mreq->m_len = 6 * NFSX_UNSIGNED;
bpos = ((caddr_t)tl) + mreq->m_len;
*tl++ = txdr_unsigned(nd->nd_retxid);
- *tl++ = rpc_reply;
+ *tl++ = nfsrv_rpc_reply;
if (err == ERPCMISMATCH || (err & NFSERR_AUTHERR)) {
- *tl++ = rpc_msgdenied;
+ *tl++ = nfsrv_rpc_msgdenied;
if (err & NFSERR_AUTHERR) {
- *tl++ = rpc_autherr;
+ *tl++ = nfsrv_rpc_autherr;
*tl = txdr_unsigned(err & ~NFSERR_AUTHERR);
mreq->m_len -= NFSX_UNSIGNED;
bpos -= NFSX_UNSIGNED;
} else {
- *tl++ = rpc_mismatch;
+ *tl++ = nfsrv_rpc_mismatch;
*tl++ = txdr_unsigned(RPC_VER2);
*tl = txdr_unsigned(RPC_VER2);
}
} else {
- *tl++ = rpc_msgaccepted;
+ *tl++ = nfsrv_rpc_msgaccepted;
/*
* Send a RPCAUTH_NULL verifier - no Kerberos.
*/
@@ -292,7 +292,7 @@ nfs_getreq(struct nfsrv_descript *nd, struct nfsd *nfsd, int has_header)
if (has_header) {
tl = nfsm_dissect(u_int32_t *, 10 * NFSX_UNSIGNED);
nd->nd_retxid = fxdr_unsigned(u_int32_t, *tl++);
- if (*tl++ != rpc_call) {
+ if (*tl++ != nfsrv_rpc_call) {
m_freem(mrep);
return (EBADRPC);
}
@@ -300,12 +300,12 @@ nfs_getreq(struct nfsrv_descript *nd, struct nfsd *nfsd, int has_header)
tl = nfsm_dissect(u_int32_t *, 8 * NFSX_UNSIGNED);
nd->nd_repstat = 0;
nd->nd_flag = 0;
- if (*tl++ != rpc_vers) {
+ if (*tl++ != nfsrv_rpc_vers) {
nd->nd_repstat = ERPCMISMATCH;
nd->nd_procnum = NFSPROC_NOOP;
return (0);
}
- if (*tl != nfs_prog) {
+ if (*tl != nfsrv_nfs_prog) {
nd->nd_repstat = EPROGUNAVAIL;
nd->nd_procnum = NFSPROC_NOOP;
return (0);
@@ -334,7 +334,7 @@ nfs_getreq(struct nfsrv_descript *nd, struct nfsd *nfsd, int has_header)
return (0);
}
/* Map the v2 procedure numbers into v3 ones */
- nd->nd_procnum = nfsv3_procid[nd->nd_procnum];
+ nd->nd_procnum = nfsrv_nfsv3_procid[nd->nd_procnum];
}
auth_type = *tl++;
len = fxdr_unsigned(int, *tl++);
@@ -346,7 +346,7 @@ nfs_getreq(struct nfsrv_descript *nd, struct nfsd *nfsd, int has_header)
/*
* Handle auth_unix;
*/
- if (auth_type == rpc_auth_unix) {
+ if (auth_type == nfsrv_rpc_auth_unix) {
len = fxdr_unsigned(int, *++tl);
if (len < 0 || len > NFS_MAXNAMLEN) {
m_freem(mrep);
@@ -763,5 +763,5 @@ nfsrv_timer(void *arg)
nfsrv_wakenfsd(slp);
}
splx(s);
- nfsrv_timer_handle = timeout(nfsrv_timer, (void *)0, nfs_ticks);
+ nfsrv_timer_handle = timeout(nfsrv_timer, (void *)0, nfsrv_ticks);
}
diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c
index 0165a80..3e57612 100644
--- a/sys/nfsserver/nfs_srvsubs.c
+++ b/sys/nfsserver/nfs_srvsubs.c
@@ -81,10 +81,11 @@ __FBSDID("$FreeBSD$");
* Data items converted to xdr at startup, since they are constant
* This is kinda hokey, but may save a little time doing byte swaps
*/
-u_int32_t nfs_xdrneg1;
-u_int32_t rpc_call, rpc_vers, rpc_reply, rpc_msgdenied, rpc_autherr,
- rpc_mismatch, rpc_auth_unix, rpc_msgaccepted;
-u_int32_t nfs_prog, nfs_true, nfs_false;
+u_int32_t nfsrv_nfs_xdrneg1;
+u_int32_t nfsrv_rpc_call, nfsrv_rpc_vers, nfsrv_rpc_reply,
+ nfsrv_rpc_msgdenied, nfsrv_rpc_autherr,
+ nfsrv_rpc_mismatch, nfsrv_rpc_auth_unix, nfsrv_rpc_msgaccepted;
+u_int32_t nfsrv_nfs_prog, nfsrv_nfs_true, nfsrv_nfs_false;
/* And other global data */
static nfstype nfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK,
@@ -92,7 +93,7 @@ static nfstype nfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK,
#define vtonfsv2_type(a) txdr_unsigned(nfsv2_type[((int32_t)(a))])
#define vtonfsv3_mode(m) txdr_unsigned((m) & ALLPERMS)
-int nfs_ticks;
+int nfsrv_ticks;
struct nfssvc_sockhead nfssvc_sockhead;
int nfssvc_sockhead_flag;
@@ -105,7 +106,7 @@ static sy_call_t *nfs_prev_nfssvc_sy_call;
/*
* Mapping of old NFS Version 2 RPC numbers to generic numbers.
*/
-int nfsv3_procid[NFS_NPROCS] = {
+int nfsrv_nfsv3_procid[NFS_NPROCS] = {
NFSPROC_NULL,
NFSPROC_GETATTR,
NFSPROC_SETATTR,
@@ -527,21 +528,21 @@ nfsrv_modevent(module_t mod, int type, void *data)
switch (type) {
case MOD_LOAD:
- rpc_vers = txdr_unsigned(RPC_VER2);
- rpc_call = txdr_unsigned(RPC_CALL);
- rpc_reply = txdr_unsigned(RPC_REPLY);
- rpc_msgdenied = txdr_unsigned(RPC_MSGDENIED);
- rpc_msgaccepted = txdr_unsigned(RPC_MSGACCEPTED);
- rpc_mismatch = txdr_unsigned(RPC_MISMATCH);
- 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_xdrneg1 = txdr_unsigned(-1);
- nfs_ticks = (hz * NFS_TICKINTVL + 500) / 1000;
- if (nfs_ticks < 1)
- nfs_ticks = 1;
+ nfsrv_rpc_vers = txdr_unsigned(RPC_VER2);
+ nfsrv_rpc_call = txdr_unsigned(RPC_CALL);
+ nfsrv_rpc_reply = txdr_unsigned(RPC_REPLY);
+ nfsrv_rpc_msgdenied = txdr_unsigned(RPC_MSGDENIED);
+ nfsrv_rpc_msgaccepted = txdr_unsigned(RPC_MSGACCEPTED);
+ nfsrv_rpc_mismatch = txdr_unsigned(RPC_MISMATCH);
+ nfsrv_rpc_autherr = txdr_unsigned(RPC_AUTHERR);
+ nfsrv_rpc_auth_unix = txdr_unsigned(RPCAUTH_UNIX);
+ nfsrv_nfs_prog = txdr_unsigned(NFS_PROG);
+ nfsrv_nfs_true = txdr_unsigned(TRUE);
+ nfsrv_nfs_false = txdr_unsigned(FALSE);
+ nfsrv_nfs_xdrneg1 = txdr_unsigned(-1);
+ nfsrv_ticks = (hz * NFS_TICKINTVL + 500) / 1000;
+ if (nfsrv_ticks < 1)
+ nfsrv_ticks = 1;
nfsrv_init(0); /* Init server data structures */
nfsrv_initcache(); /* Init the server request cache */
@@ -932,10 +933,10 @@ nfsm_srvwcc(struct nfsrv_descript *nfsd, int before_ret,
if (before_ret) {
tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
- *tl = nfs_false;
+ *tl = nfsrv_nfs_false;
} else {
tl = nfsm_build(u_int32_t *, 7 * NFSX_UNSIGNED);
- *tl++ = nfs_true;
+ *tl++ = nfsrv_nfs_true;
txdr_hyper(before_vap->va_size, tl);
tl += 2;
txdr_nfsv3time(&(before_vap->va_mtime), tl);
@@ -958,10 +959,10 @@ nfsm_srvpostopattr(struct nfsrv_descript *nfsd, int after_ret,
if (after_ret) {
tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED);
- *tl = nfs_false;
+ *tl = nfsrv_nfs_false;
} else {
tl = nfsm_build(u_int32_t *, NFSX_UNSIGNED + NFSX_V3FATTR);
- *tl++ = nfs_true;
+ *tl++ = nfsrv_nfs_true;
fp = (struct nfs_fattr *)tl;
nfsm_srvfattr(nfsd, after_vap, fp);
}
@@ -1222,7 +1223,7 @@ nfsm_srvpostop_fh_xx(fhandle_t *f, struct mbuf **mb, caddr_t *bpos)
u_int32_t *tl;
tl = nfsm_build_xx(2 * NFSX_UNSIGNED + NFSX_V3FH, mb, bpos);
- *tl++ = nfs_true;
+ *tl++ = nfsrv_nfs_true;
*tl++ = txdr_unsigned(NFSX_V3FH);
bcopy(f, tl, NFSX_V3FH);
}
@@ -1313,7 +1314,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct mbuf **md, caddr_t *dpos)
tl = nfsm_dissect_xx(NFSX_UNSIGNED, md, dpos);
if (tl == NULL)
return EBADRPC;
- if (*tl == nfs_true) {
+ if (*tl == nfsrv_nfs_true) {
tl = nfsm_dissect_xx(NFSX_UNSIGNED, md, dpos);
if (tl == NULL)
return EBADRPC;
@@ -1322,7 +1323,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct mbuf **md, caddr_t *dpos)
tl = nfsm_dissect_xx(NFSX_UNSIGNED, md, dpos);
if (tl == NULL)
return EBADRPC;
- if (*tl == nfs_true) {
+ if (*tl == nfsrv_nfs_true) {
tl = nfsm_dissect_xx(NFSX_UNSIGNED, md, dpos);
if (tl == NULL)
return EBADRPC;
@@ -1331,7 +1332,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct mbuf **md, caddr_t *dpos)
tl = nfsm_dissect_xx(NFSX_UNSIGNED, md, dpos);
if (tl == NULL)
return EBADRPC;
- if (*tl == nfs_true) {
+ if (*tl == nfsrv_nfs_true) {
tl = nfsm_dissect_xx(NFSX_UNSIGNED, md, dpos);
if (tl == NULL)
return EBADRPC;
@@ -1340,7 +1341,7 @@ nfsm_srvsattr_xx(struct vattr *a, struct mbuf **md, caddr_t *dpos)
tl = nfsm_dissect_xx(NFSX_UNSIGNED, md, dpos);
if (tl == NULL)
return EBADRPC;
- if (*tl == nfs_true) {
+ if (*tl == nfsrv_nfs_true) {
tl = nfsm_dissect_xx(2 * NFSX_UNSIGNED, md, dpos);
if (tl == NULL)
return EBADRPC;
diff --git a/sys/nfsserver/nfs_syscalls.c b/sys/nfsserver/nfs_syscalls.c
index 73935f8..39f6e61 100644
--- a/sys/nfsserver/nfs_syscalls.c
+++ b/sys/nfsserver/nfs_syscalls.c
@@ -77,9 +77,6 @@ MALLOC_DEFINE(M_NFSRVDESC, "NFSV3 srvdesc", "NFS server socket descriptor");
MALLOC_DEFINE(M_NFSD, "NFS daemon", "Nfs server daemon structure");
-/* Global defs. */
-struct nfsrvstats nfsrvstats;
-
#define TRUE 1
#define FALSE 0
OpenPOWER on IntegriCloud