Bring back the code to prime the ACCESS cache when fetching attributes for
an NFS file. Now the priming is conditional on a new vfs.nfs.prime_access_cache sysctl. For now I've left the default setting to disabling the priming. Requested by: scottl
This commit is contained in:
parent
92a0357875
commit
fdd1a964d1
@ -208,6 +208,11 @@ static int nfsaccess_cache_timeout = NFS_MAXATTRTIMO;
|
|||||||
SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW,
|
SYSCTL_INT(_vfs_nfs, OID_AUTO, access_cache_timeout, CTLFLAG_RW,
|
||||||
&nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout");
|
&nfsaccess_cache_timeout, 0, "NFS ACCESS cache timeout");
|
||||||
|
|
||||||
|
static int nfs_prime_access_cache = 0;
|
||||||
|
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;
|
static int nfsv3_commit_on_close = 0;
|
||||||
SYSCTL_INT(_vfs_nfs, OID_AUTO, nfsv3_commit_on_close, CTLFLAG_RW,
|
SYSCTL_INT(_vfs_nfs, OID_AUTO, nfsv3_commit_on_close, CTLFLAG_RW,
|
||||||
&nfsv3_commit_on_close, 0, "write+commit on close, else only write");
|
&nfsv3_commit_on_close, 0, "write+commit on close, else only write");
|
||||||
@ -644,6 +649,12 @@ nfs_getattr(struct vop_getattr_args *ap)
|
|||||||
*/
|
*/
|
||||||
if (nfs_getattrcache(vp, &vattr) == 0)
|
if (nfs_getattrcache(vp, &vattr) == 0)
|
||||||
goto nfsmout;
|
goto nfsmout;
|
||||||
|
if (v3 && nfs_prime_access_cache && nfsaccess_cache_timeout > 0) {
|
||||||
|
nfsstats.accesscache_misses++;
|
||||||
|
nfs3_access_otw(vp, NFSV3ACCESS_ALL, td, ap->a_cred);
|
||||||
|
if (nfs_getattrcache(vp, &vattr) == 0)
|
||||||
|
goto nfsmout;
|
||||||
|
}
|
||||||
nfsstats.rpccnt[NFSPROC_GETATTR]++;
|
nfsstats.rpccnt[NFSPROC_GETATTR]++;
|
||||||
mreq = nfsm_reqhead(vp, NFSPROC_GETATTR, NFSX_FH(v3));
|
mreq = nfsm_reqhead(vp, NFSPROC_GETATTR, NFSX_FH(v3));
|
||||||
mb = mreq;
|
mb = mreq;
|
||||||
|
Loading…
Reference in New Issue
Block a user