summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vnops.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>1999-10-25 19:22:33 +0000
committerdillon <dillon@FreeBSD.org>1999-10-25 19:22:33 +0000
commit47a282162ea4215b5a0d04243764b1ed01e940d1 (patch)
tree12de8c66d0dfabb52a0ffd4615bb0ec6423af948 /sys/nfsclient/nfs_vnops.c
parentb01e7dfec48f888fe52eb636a2d9c36a0db6c1b6 (diff)
downloadFreeBSD-src-47a282162ea4215b5a0d04243764b1ed01e940d1.zip
FreeBSD-src-47a282162ea4215b5a0d04243764b1ed01e940d1.tar.gz
Move NFS access cache hits/misses into nfsstats structure so
/usr/bin/nfsstat can get to it easily.
Diffstat (limited to 'sys/nfsclient/nfs_vnops.c')
-rw-r--r--sys/nfsclient/nfs_vnops.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sys/nfsclient/nfs_vnops.c b/sys/nfsclient/nfs_vnops.c
index 2d736f5..816273e 100644
--- a/sys/nfsclient/nfs_vnops.c
+++ b/sys/nfsclient/nfs_vnops.c
@@ -252,13 +252,13 @@ static int nfsaccess_cache_timeout = NFS_MAXATTRTIMO;
SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW,
&nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout");
-static int nfsaccess_cache_hits;
+#if 0
SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_hits, CTLFLAG_RD,
- &nfsaccess_cache_hits, 0, "NFS ACCESS cache hit count");
+ &nfsstats.accesscache_hits, 0, "NFS ACCESS cache hit count");
-static int nfsaccess_cache_misses;
SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_misses, CTLFLAG_RD,
- &nfsaccess_cache_misses, 0, "NFS ACCESS cache miss count");
+ &nfsstats.accesscache_misses, 0, "NFS ACCESS cache miss count");
+#endif
#define NFSV3ACCESS_ALL (NFSV3ACCESS_READ | NFSV3ACCESS_MODIFY \
| NFSV3ACCESS_EXTEND | NFSV3ACCESS_EXECUTE \
@@ -375,12 +375,12 @@ nfs_access(ap)
if ((time_second < (np->n_modestamp + nfsaccess_cache_timeout)) &&
(ap->a_cred->cr_uid == np->n_modeuid) &&
((np->n_mode & mode) == mode)) {
- nfsaccess_cache_hits++;
+ nfsstats.accesscache_hits++;
} else {
/*
* Either a no, or a don't know. Go to the wire.
*/
- nfsaccess_cache_misses++;
+ nfsstats.accesscache_misses++;
error = nfs3_access_otw(vp, wmode, ap->a_p,ap->a_cred);
if (!error) {
if ((np->n_mode & mode) != mode) {
@@ -610,6 +610,7 @@ nfs_getattr(ap)
return (0);
if (v3 && nfsaccess_cache_timeout > 0) {
+ nfsstats.accesscache_misses++;
nfs3_access_otw(vp, NFSV3ACCESS_ALL, ap->a_p, ap->a_cred);
if (nfs_getattrcache(vp, ap->a_vap) == 0)
return (0);
OpenPOWER on IntegriCloud