Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 308575
b: refs/heads/master
c: b4b1ead
h: refs/heads/master
i:
  308573: a7f0478
  308571: bdedca5
  308567: a879ae8
  308559: 32fa1d1
  308543: 60e5e84
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed May 1, 2012
1 parent c1bca2d commit 153edc0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e144cbcc251f16c1a14b9256cda73ab4aebe933a
refs/heads/master: b4b1eadf7c5f00636500ad47f68edc0666e63ea5
13 changes: 10 additions & 3 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,15 @@ static int nfs_invalidate_mapping(struct inode *inode, struct address_space *map
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
* @inode - pointer to host inode
Expand All @@ -880,9 +889,7 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping)
struct nfs_inode *nfsi = NFS_I(inode);
int ret = 0;

if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE)
|| nfs_attribute_cache_expired(inode)
|| NFS_STALE(inode)) {
if (nfs_mapping_need_revalidate_inode(inode)) {
ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode);
if (ret < 0)
goto out;
Expand Down

0 comments on commit 153edc0

Please sign in to comment.