Skip to content

Commit

Permalink
NFS: Replace last uses of NFS_INO_REVAL_PAGECACHE
Browse files Browse the repository at this point in the history
Now that we have more fine grained attribute revalidation, let's just
get rid of NFS_INO_REVAL_PAGECACHE.

Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
Trond Myklebust committed Feb 25, 2022
1 parent 50c790a commit 88a6099
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
24 changes: 11 additions & 13 deletions fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,17 @@ static void nfs_zap_caches_locked(struct inode *inode)
nfsi->attrtimeo = NFS_MINATTRTIMEO(inode);
nfsi->attrtimeo_timestamp = jiffies;

if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode)) {
nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATTR
| NFS_INO_INVALID_DATA
| NFS_INO_INVALID_ACCESS
| NFS_INO_INVALID_ACL
| NFS_INO_INVALID_XATTR
| NFS_INO_REVAL_PAGECACHE);
} else
nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATTR
| NFS_INO_INVALID_ACCESS
| NFS_INO_INVALID_ACL
| NFS_INO_INVALID_XATTR
| NFS_INO_REVAL_PAGECACHE);
if (S_ISREG(mode) || S_ISDIR(mode) || S_ISLNK(mode))
nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATTR |
NFS_INO_INVALID_DATA |
NFS_INO_INVALID_ACCESS |
NFS_INO_INVALID_ACL |
NFS_INO_INVALID_XATTR);
else
nfs_set_cache_invalid(inode, NFS_INO_INVALID_ATTR |
NFS_INO_INVALID_ACCESS |
NFS_INO_INVALID_ACL |
NFS_INO_INVALID_XATTR);
nfs_zap_label_cache_locked(nfsi);
}

Expand Down
2 changes: 1 addition & 1 deletion fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ static void nfs_set_pageerror(struct address_space *mapping)
/* Force file size revalidation */
spin_lock(&inode->i_lock);
nfs_set_cache_invalid(inode, NFS_INO_REVAL_FORCED |
NFS_INO_REVAL_PAGECACHE |
NFS_INO_INVALID_CHANGE |
NFS_INO_INVALID_SIZE);
spin_unlock(&inode->i_lock);
}
Expand Down
8 changes: 3 additions & 5 deletions include/linux/nfs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,9 @@ static inline void nfs_mark_for_revalidate(struct inode *inode)
struct nfs_inode *nfsi = NFS_I(inode);

spin_lock(&inode->i_lock);
nfsi->cache_validity |= NFS_INO_REVAL_PAGECACHE
| NFS_INO_INVALID_ACCESS
| NFS_INO_INVALID_ACL
| NFS_INO_INVALID_CHANGE
| NFS_INO_INVALID_CTIME;
nfsi->cache_validity |= NFS_INO_INVALID_ACCESS | NFS_INO_INVALID_ACL |
NFS_INO_INVALID_CHANGE | NFS_INO_INVALID_CTIME |
NFS_INO_INVALID_SIZE;
if (S_ISDIR(inode->i_mode))
nfsi->cache_validity |= NFS_INO_INVALID_DATA;
spin_unlock(&inode->i_lock);
Expand Down

0 comments on commit 88a6099

Please sign in to comment.