Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Mar 2009 15:52:12 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r190159 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb nfsclient
Message-ID:  <200903201552.n2KFqCnw006887@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Fri Mar 20 15:52:11 2009
New Revision: 190159
URL: http://svn.freebsd.org/changeset/base/190159

Log:
  MFC: Add a new vfs.nfs.prime_access_cache sysctl to determine whether or
  not nfs_getattr() will use an ACCESS RPC to prime the access cache instead
  of a simple GETATTR RPC.  The sysctl defaults to enabled to maintain the
  previous behavior.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/nfsclient/nfs_vnops.c

Modified: stable/7/sys/nfsclient/nfs_vnops.c
==============================================================================
--- stable/7/sys/nfsclient/nfs_vnops.c	Fri Mar 20 14:32:51 2009	(r190158)
+++ stable/7/sys/nfsclient/nfs_vnops.c	Fri Mar 20 15:52:11 2009	(r190159)
@@ -208,6 +208,11 @@ static int	nfsaccess_cache_timeout = NFS
 SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW,
 	   &nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout");
 
+static int	nfs_prime_access_cache = 1;
+SYSCTL_INT(_vfs_nfs, OID_AUTO, prime_access_cache, CTLFLAG_RW,
+	   &nfs_prime_access_cache, 0,
+	   "Prime NFS ACCESS cache when fetching attributes");
+
 static int	nfsv3_commit_on_close = 0;
 SYSCTL_INT(_vfs_nfs, OID_AUTO, nfsv3_commit_on_close, CTLFLAG_RW,
 	   &nfsv3_commit_on_close, 0, "write+commit on close, else only write");
@@ -643,7 +648,7 @@ nfs_getattr(struct vop_getattr_args *ap)
 	 */
 	if (nfs_getattrcache(vp, &vattr) == 0)
 		goto nfsmout;
-	if (v3 && nfsaccess_cache_timeout > 0) {
+	if (v3 && nfs_prime_access_cache && nfsaccess_cache_timeout > 0) {
 		nfsstats.accesscache_misses++;
 		nfs3_access_otw(vp, NFSV3ACCESS_ALL, ap->a_td, ap->a_cred);
 		if (nfs_getattrcache(vp, &vattr) == 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903201552.n2KFqCnw006887>