diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-12-14 14:36:36 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-12-14 14:36:36 -0500 |
commit | eed9935745cc44071043ec8c4cde64c820b5c601 (patch) | |
tree | cdbfb893753acd43fddee09a5d34b16e2422cd34 /fs/nfs | |
parent | 48d7a57693af660666c4afdc54c09b2f9655e260 (diff) |
NFS: Ensure that we always drop inodes that have been marked as stale
There is no need to cache stale inodes.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/inode.c | 6 | ||||
-rw-r--r-- | fs/nfs/internal.h | 1 | ||||
-rw-r--r-- | fs/nfs/nfs4super.c | 1 | ||||
-rw-r--r-- | fs/nfs/super.c | 1 |
4 files changed, 9 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 117183b1ee09..2faae14d89f4 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -107,6 +107,12 @@ u64 nfs_compat_user_ino64(u64 fileid) | |||
107 | return ino; | 107 | return ino; |
108 | } | 108 | } |
109 | 109 | ||
110 | int nfs_drop_inode(struct inode *inode) | ||
111 | { | ||
112 | return NFS_STALE(inode) || generic_drop_inode(inode); | ||
113 | } | ||
114 | EXPORT_SYMBOL_GPL(nfs_drop_inode); | ||
115 | |||
110 | void nfs_clear_inode(struct inode *inode) | 116 | void nfs_clear_inode(struct inode *inode) |
111 | { | 117 | { |
112 | /* | 118 | /* |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 89c1ee4a432c..f0e6c7df1a07 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -296,6 +296,7 @@ extern struct workqueue_struct *nfsiod_workqueue; | |||
296 | extern struct inode *nfs_alloc_inode(struct super_block *sb); | 296 | extern struct inode *nfs_alloc_inode(struct super_block *sb); |
297 | extern void nfs_destroy_inode(struct inode *); | 297 | extern void nfs_destroy_inode(struct inode *); |
298 | extern int nfs_write_inode(struct inode *, struct writeback_control *); | 298 | extern int nfs_write_inode(struct inode *, struct writeback_control *); |
299 | extern int nfs_drop_inode(struct inode *); | ||
299 | extern void nfs_clear_inode(struct inode *); | 300 | extern void nfs_clear_inode(struct inode *); |
300 | extern void nfs_evict_inode(struct inode *); | 301 | extern void nfs_evict_inode(struct inode *); |
301 | void nfs_zap_acl_cache(struct inode *inode); | 302 | void nfs_zap_acl_cache(struct inode *inode); |
diff --git a/fs/nfs/nfs4super.c b/fs/nfs/nfs4super.c index bd61221ad2c5..84d2e9e2f313 100644 --- a/fs/nfs/nfs4super.c +++ b/fs/nfs/nfs4super.c | |||
@@ -51,6 +51,7 @@ static const struct super_operations nfs4_sops = { | |||
51 | .alloc_inode = nfs_alloc_inode, | 51 | .alloc_inode = nfs_alloc_inode, |
52 | .destroy_inode = nfs_destroy_inode, | 52 | .destroy_inode = nfs_destroy_inode, |
53 | .write_inode = nfs4_write_inode, | 53 | .write_inode = nfs4_write_inode, |
54 | .drop_inode = nfs_drop_inode, | ||
54 | .put_super = nfs_put_super, | 55 | .put_super = nfs_put_super, |
55 | .statfs = nfs_statfs, | 56 | .statfs = nfs_statfs, |
56 | .evict_inode = nfs4_evict_inode, | 57 | .evict_inode = nfs4_evict_inode, |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index e12cea4b36a5..aa5315bb3666 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -308,6 +308,7 @@ const struct super_operations nfs_sops = { | |||
308 | .alloc_inode = nfs_alloc_inode, | 308 | .alloc_inode = nfs_alloc_inode, |
309 | .destroy_inode = nfs_destroy_inode, | 309 | .destroy_inode = nfs_destroy_inode, |
310 | .write_inode = nfs_write_inode, | 310 | .write_inode = nfs_write_inode, |
311 | .drop_inode = nfs_drop_inode, | ||
311 | .put_super = nfs_put_super, | 312 | .put_super = nfs_put_super, |
312 | .statfs = nfs_statfs, | 313 | .statfs = nfs_statfs, |
313 | .evict_inode = nfs_evict_inode, | 314 | .evict_inode = nfs_evict_inode, |