aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2020-04-06 13:39:29 -0400
committerTrond Myklebust <trond.myklebust@hammerspace.com>2020-04-06 13:56:33 -0400
commit93ce4af774bc3d8a72ce2271d03241c96383629d (patch)
treeda860178b1a7f7104197f040e77c9d96efc403a1 /fs/nfs/dir.c
parent1fab7dc477241c12f977955aa6baea7938b6f08d (diff)
downloadlinux-93ce4af774bc3d8a72ce2271d03241c96383629d.tar.gz
NFS: Clean up process of marking inode stale.
Instead of the various open coded calls to set the NFS_INO_STALE bit and call nfs_zap_caches(), consolidate them into a single function nfs_set_inode_stale(). Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index f14184d0ba829..d729d8311c7ec 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2669,9 +2669,10 @@ static int nfs_do_access(struct inode *inode, const struct cred *cred, int mask)
status = NFS_PROTO(inode)->access(inode, &cache);
if (status != 0) {
if (status == -ESTALE) {
- nfs_zap_caches(inode);
if (!S_ISDIR(inode->i_mode))
- set_bit(NFS_INO_STALE, &NFS_I(inode)->flags);
+ nfs_set_inode_stale(inode);
+ else
+ nfs_zap_caches(inode);
}
goto out;
}