summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfsnode.h
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1998-11-13 02:39:09 +0000
committermsmith <msmith@FreeBSD.org>1998-11-13 02:39:09 +0000
commit5ffcaa816e1e6651a03c2d98d79b3a2fa7a6c1c4 (patch)
tree9877e3cdae8ee1835930e2eb46c798b2e03782d2 /sys/nfs/nfsnode.h
parent841cc6703ab79abc6b11c4118fe76d9c2ebb4928 (diff)
downloadFreeBSD-src-5ffcaa816e1e6651a03c2d98d79b3a2fa7a6c1c4.zip
FreeBSD-src-5ffcaa816e1e6651a03c2d98d79b3a2fa7a6c1c4.tar.gz
Implement NFS ACCESS RPC result caching.
This yields startling performance increases for NFS clients for many access profiles, due to the fact that ACCESS results are persistently cached in the namecache in many cases. Note that the code is somewhat conservative in that it requires an exact credential match for a cache hit. This bloats the nfsnode structure by sizeof(struct ucred) (96 bytes). Any less conservative approach opens the possibility for a false veto in eg. setuid applications. Alternative suggestions would be welcomed. The cache is normally disabled, to activate set the sysctl variable vfs.nfs.access_cache_timeout to a nonzero value. This is the time in seconds that a cached entry will be considered valid; useful values appear to be 2-10 seconds. Performance of the cache can be monitored with the vfs.nfs.access_cache_hits and vfs.nfs.access_cache_hits variables.
Diffstat (limited to 'sys/nfs/nfsnode.h')
-rw-r--r--sys/nfs/nfsnode.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/nfs/nfsnode.h b/sys/nfs/nfsnode.h
index 51f5d78..b242216 100644
--- a/sys/nfs/nfsnode.h
+++ b/sys/nfs/nfsnode.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfsnode.h 8.9 (Berkeley) 5/14/95
- * $Id: nfsnode.h,v 1.25 1998/03/06 09:46:52 msmith Exp $
+ * $Id: nfsnode.h,v 1.26 1998/05/31 18:32:23 peter Exp $
*/
@@ -93,6 +93,9 @@ struct nfsnode {
u_quad_t n_lrev; /* Modify rev for lease */
struct vattr n_vattr; /* Vnode attribute cache */
time_t n_attrstamp; /* Attr. cache timestamp */
+ u_int32_t n_mode; /* ACCESS mode cache */
+ struct ucred n_modecred; /* credentials having mode */
+ time_t n_modestamp; /* mode cache timestamp */
time_t n_mtime; /* Prev modify time. */
time_t n_ctime; /* Prev create time. */
time_t n_expiry; /* Lease expiry time */
OpenPOWER on IntegriCloud