Explorar o código

NFS: Use delegations to optimise ACCESS calls

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Trond Myklebust %!s(int64=16) %!d(string=hai) anos
pai
achega
7a50c60e46
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      fs/nfs/dir.c

+ 2 - 1
fs/nfs/dir.c

@@ -1797,7 +1797,8 @@ static int nfs_access_get_cached(struct inode *inode, struct rpc_cred *cred, str
 	cache = nfs_access_search_rbtree(inode, cred);
 	if (cache == NULL)
 		goto out;
-	if (!time_in_range(jiffies, cache->jiffies, cache->jiffies + nfsi->attrtimeo))
+	if (!nfs_have_delegation(inode, FMODE_READ) &&
+	    !time_in_range(jiffies, cache->jiffies, cache->jiffies + nfsi->attrtimeo))
 		goto out_stale;
 	res->jiffies = cache->jiffies;
 	res->cred = cache->cred;