From owner-svn-src-all@FreeBSD.ORG Fri Mar 20 16:02:37 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7A361065688; Fri, 20 Mar 2009 16:02:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4BA18FC2A; Fri, 20 Mar 2009 16:02:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2KG2bUQ007142; Fri, 20 Mar 2009 16:02:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2KG2bak007141; Fri, 20 Mar 2009 16:02:37 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903201602.n2KG2bak007141@svn.freebsd.org> From: John Baldwin Date: Fri, 20 Mar 2009 16:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190160 - in stable/6/sys: . contrib/pf dev/cxgb nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Mar 2009 16:02:38 -0000 Author: jhb Date: Fri Mar 20 16:02:37 2009 New Revision: 190160 URL: http://svn.freebsd.org/changeset/base/190160 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/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) stable/6/sys/nfsclient/nfs_vnops.c Modified: stable/6/sys/nfsclient/nfs_vnops.c ============================================================================== --- stable/6/sys/nfsclient/nfs_vnops.c Fri Mar 20 15:52:11 2009 (r190159) +++ stable/6/sys/nfsclient/nfs_vnops.c Fri Mar 20 16:02:37 2009 (r190160) @@ -205,6 +205,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"); @@ -585,7 +590,7 @@ nfs_getattr(struct vop_getattr_args *ap) if (nfs_getattrcache(vp, ap->a_vap) == 0) return (0); - 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, ap->a_vap) == 0)