diff options
author | dillon <dillon@FreeBSD.org> | 1999-10-25 19:22:33 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 1999-10-25 19:22:33 +0000 |
commit | 47a282162ea4215b5a0d04243764b1ed01e940d1 (patch) | |
tree | 12de8c66d0dfabb52a0ffd4615bb0ec6423af948 | |
parent | b01e7dfec48f888fe52eb636a2d9c36a0db6c1b6 (diff) | |
download | FreeBSD-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.
-rw-r--r-- | sys/nfs/nfs.h | 2 | ||||
-rw-r--r-- | sys/nfs/nfs_vnops.c | 13 | ||||
-rw-r--r-- | sys/nfsclient/nfs.h | 2 | ||||
-rw-r--r-- | sys/nfsclient/nfs_vnops.c | 13 | ||||
-rw-r--r-- | sys/nfsclient/nfsargs.h | 2 | ||||
-rw-r--r-- | sys/nfsclient/nfsstats.h | 2 | ||||
-rw-r--r-- | sys/nfsserver/nfs.h | 2 | ||||
-rw-r--r-- | sys/nfsserver/nfsrvstats.h | 2 |
8 files changed, 26 insertions, 12 deletions
diff --git a/sys/nfs/nfs.h b/sys/nfs/nfs.h index 296e34f..75a3982 100644 --- a/sys/nfs/nfs.h +++ b/sys/nfs/nfs.h @@ -271,6 +271,8 @@ struct nfsstats { int srvnqnfs_maxleases; int srvnqnfs_getleases; int srvvop_writes; + int accesscache_hits; + int accesscache_misses; }; #endif diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 2d736f5..816273e 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/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); diff --git a/sys/nfsclient/nfs.h b/sys/nfsclient/nfs.h index 296e34f..75a3982 100644 --- a/sys/nfsclient/nfs.h +++ b/sys/nfsclient/nfs.h @@ -271,6 +271,8 @@ struct nfsstats { int srvnqnfs_maxleases; int srvnqnfs_getleases; int srvvop_writes; + int accesscache_hits; + int accesscache_misses; }; #endif 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); diff --git a/sys/nfsclient/nfsargs.h b/sys/nfsclient/nfsargs.h index 296e34f..75a3982 100644 --- a/sys/nfsclient/nfsargs.h +++ b/sys/nfsclient/nfsargs.h @@ -271,6 +271,8 @@ struct nfsstats { int srvnqnfs_maxleases; int srvnqnfs_getleases; int srvvop_writes; + int accesscache_hits; + int accesscache_misses; }; #endif diff --git a/sys/nfsclient/nfsstats.h b/sys/nfsclient/nfsstats.h index 296e34f..75a3982 100644 --- a/sys/nfsclient/nfsstats.h +++ b/sys/nfsclient/nfsstats.h @@ -271,6 +271,8 @@ struct nfsstats { int srvnqnfs_maxleases; int srvnqnfs_getleases; int srvvop_writes; + int accesscache_hits; + int accesscache_misses; }; #endif diff --git a/sys/nfsserver/nfs.h b/sys/nfsserver/nfs.h index 296e34f..75a3982 100644 --- a/sys/nfsserver/nfs.h +++ b/sys/nfsserver/nfs.h @@ -271,6 +271,8 @@ struct nfsstats { int srvnqnfs_maxleases; int srvnqnfs_getleases; int srvvop_writes; + int accesscache_hits; + int accesscache_misses; }; #endif diff --git a/sys/nfsserver/nfsrvstats.h b/sys/nfsserver/nfsrvstats.h index 296e34f..75a3982 100644 --- a/sys/nfsserver/nfsrvstats.h +++ b/sys/nfsserver/nfsrvstats.h @@ -271,6 +271,8 @@ struct nfsstats { int srvnqnfs_maxleases; int srvnqnfs_getleases; int srvvop_writes; + int accesscache_hits; + int accesscache_misses; }; #endif |