Skip to content
Snippets Groups Projects
Commit b4b1eadf authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFS: Don't force page cache revalidations when holding a delegation


If we're holding a delegation, then we already know that our
page cache is valid.

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent e144cbcc
No related merge requests found
...@@ -870,6 +870,15 @@ static int nfs_invalidate_mapping(struct inode *inode, struct address_space *map ...@@ -870,6 +870,15 @@ static int nfs_invalidate_mapping(struct inode *inode, struct address_space *map
return 0; return 0;
} }
static bool nfs_mapping_need_revalidate_inode(struct inode *inode)
{
if (nfs_have_delegated_attributes(inode))
return false;
return (NFS_I(inode)->cache_validity & NFS_INO_REVAL_PAGECACHE)
|| nfs_attribute_timeout(inode)
|| NFS_STALE(inode);
}
/** /**
* nfs_revalidate_mapping - Revalidate the pagecache * nfs_revalidate_mapping - Revalidate the pagecache
* @inode - pointer to host inode * @inode - pointer to host inode
...@@ -880,9 +889,7 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) ...@@ -880,9 +889,7 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping)
struct nfs_inode *nfsi = NFS_I(inode); struct nfs_inode *nfsi = NFS_I(inode);
int ret = 0; int ret = 0;
if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) if (nfs_mapping_need_revalidate_inode(inode)) {
|| nfs_attribute_cache_expired(inode)
|| NFS_STALE(inode)) {
ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment