summaryrefslogtreecommitdiffstats
path: root/sys/nfs4client
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2007-01-25 14:33:13 +0000
committerbde <bde@FreeBSD.org>2007-01-25 14:33:13 +0000
commitabf353c8bd6862d3f0090ac847b30a296913bc54 (patch)
treee78f4c6e4452adbb3360586ce5a27eab2a4a8f83 /sys/nfs4client
parent2bc6f7d071c18f2f02c14b02b9fb3265bb15c056 (diff)
downloadFreeBSD-src-abf353c8bd6862d3f0090ac847b30a296913bc54.zip
FreeBSD-src-abf353c8bd6862d3f0090ac847b30a296913bc54.tar.gz
Rename some functions and variables from nfs_* to nfs4_* to avoid
collisions with nfsclient's names. Even static names should have a unique prefix so that they can be debugged easily. Hide the unused colliding variable nfsv3_commit_on_close in "#if 0" together with other unused sysctl variables. Duplicating the nfs sysctl under nfs4 is probably just a bug. Fix some nearby style bugs. Remove duplicate $FreeBSD$.
Diffstat (limited to 'sys/nfs4client')
-rw-r--r--sys/nfs4client/nfs4_vnops.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/sys/nfs4client/nfs4_vnops.c b/sys/nfs4client/nfs4_vnops.c
index 419fc88..cfa52e2 100644
--- a/sys/nfs4client/nfs4_vnops.c
+++ b/sys/nfs4client/nfs4_vnops.c
@@ -1,4 +1,3 @@
-/* $FreeBSD$ */
/* $Id: nfs_vnops.c,v 1.45 2003/11/05 14:59:02 rees Exp $ */
/*-
@@ -220,14 +219,15 @@ struct nfs4_lowner nfs4_masterlowner;
SYSCTL_DECL(_vfs_nfs4);
-static int nfsaccess_cache_timeout = NFS_MAXATTRTIMO;
+static int nfs4_access_cache_timeout = NFS_MAXATTRTIMO;
SYSCTL_INT(_vfs_nfs4, OID_AUTO, access_cache_timeout, CTLFLAG_RW,
- &nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout");
+ &nfs4_access_cache_timeout, 0, "NFS ACCESS cache timeout");
+#if 0
static int nfsv3_commit_on_close = 0;
SYSCTL_INT(_vfs_nfs4, OID_AUTO, nfsv3_commit_on_close, CTLFLAG_RW,
&nfsv3_commit_on_close, 0, "write+commit on close, else only write");
-#if 0
+
SYSCTL_INT(_vfs_nfs4, OID_AUTO, access_cache_hits, CTLFLAG_RD,
&nfsstats.accesscache_hits, 0, "NFS ACCESS cache hit count");
@@ -239,7 +239,7 @@ SYSCTL_INT(_vfs_nfs4, OID_AUTO, access_cache_misses, CTLFLAG_RD,
| NFSV3ACCESS_EXTEND | NFSV3ACCESS_EXECUTE \
| NFSV3ACCESS_DELETE | NFSV3ACCESS_LOOKUP)
static int
-nfs3_access_otw(struct vnode *vp, int wmode, struct thread *td,
+nfs4_v3_access_otw(struct vnode *vp, int wmode, struct thread *td,
struct ucred *cred)
{
const int v3 = 1;
@@ -337,7 +337,7 @@ nfs4_access(struct vop_access_args *ap)
mode |= NFSV3ACCESS_LOOKUP;
}
/* XXX safety belt, only make blanket request if caching */
- if (nfsaccess_cache_timeout > 0) {
+ if (nfs4_access_cache_timeout > 0) {
wmode = NFSV3ACCESS_READ | NFSV3ACCESS_MODIFY |
NFSV3ACCESS_EXTEND | NFSV3ACCESS_EXECUTE |
NFSV3ACCESS_DELETE | NFSV3ACCESS_LOOKUP;
@@ -349,20 +349,20 @@ nfs4_access(struct vop_access_args *ap)
* Does our cached result allow us to give a definite yes to
* this request?
*/
- if ((time_second < (np->n_modestamp + nfsaccess_cache_timeout)) &&
- (ap->a_cred->cr_uid == np->n_modeuid) &&
- ((np->n_mode & mode) == mode)) {
+ if (time_second < np->n_modestamp + nfs4_access_cache_timeout &&
+ ap->a_cred->cr_uid == np->n_modeuid &&
+ (np->n_mode & mode) == mode) {
nfsstats.accesscache_hits++;
} else {
/*
* Either a no, or a don't know. Go to the wire.
*/
nfsstats.accesscache_misses++;
- error = nfs3_access_otw(vp, wmode, ap->a_td,ap->a_cred);
- if (!error) {
- if ((np->n_mode & mode) != mode) {
+ error = nfs4_v3_access_otw(vp, wmode, ap->a_td,
+ ap->a_cred);
+ if (error == 0) {
+ if ((np->n_mode & mode) != mode)
error = EACCES;
- }
}
}
return (error);
OpenPOWER on IntegriCloud