summaryrefslogtreecommitdiffstats
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-10-03 01:21:49 +0200
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-10-04 02:49:07 +0200
commit36a10a3c4cb6ea7c8bd895c16b3f59e1f0db2f6a (patch)
tree8a4f6415224502ce7d51bb8f259a0701ce74a85b /fs/nfs/inode.c
parentNFS: Do not flush the readdir cache in nfs_dentry_iput() (diff)
downloadlinux-36a10a3c4cb6ea7c8bd895c16b3f59e1f0db2f6a.tar.xz
linux-36a10a3c4cb6ea7c8bd895c16b3f59e1f0db2f6a.zip
NFS: Remove unnecessary page cache invalidations
Remove cache invalidations that are already covered by change attribute updates. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r--fs/nfs/inode.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index dcb885b7ad73..3bd0ae438663 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -1451,8 +1451,6 @@ static void nfs_wcc_update_inode(struct inode *inode, struct nfs_fattr *fattr)
&& (fattr->valid & NFS_ATTR_FATTR_MTIME)
&& timespec64_equal(&ts, &fattr->pre_mtime)) {
inode->i_mtime = fattr->mtime;
- if (S_ISDIR(inode->i_mode))
- nfs_set_cache_invalid(inode, NFS_INO_INVALID_DATA);
}
if ((fattr->valid & NFS_ATTR_FATTR_PRESIZE)
&& (fattr->valid & NFS_ATTR_FATTR_SIZE)
@@ -2162,11 +2160,8 @@ static int nfs_update_inode(struct inode *inode, struct nfs_fattr *fattr)
save_cache_validity & NFS_INO_INVALID_OTHER;
if (fattr->valid & NFS_ATTR_FATTR_NLINK) {
- if (inode->i_nlink != fattr->nlink) {
- if (S_ISDIR(inode->i_mode))
- invalid |= NFS_INO_INVALID_DATA;
+ if (inode->i_nlink != fattr->nlink)
set_nlink(inode, fattr->nlink);
- }
} else if (fattr_supported & NFS_ATTR_FATTR_NLINK)
nfsi->cache_validity |=
save_cache_validity & NFS_INO_INVALID_NLINK;