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>
This commit is contained in:
Trond Myklebust 2012-12-14 14:36:36 -05:00
parent 48d7a57693
commit eed9935745
4 changed files with 9 additions and 0 deletions

View File

@ -107,6 +107,12 @@ u64 nfs_compat_user_ino64(u64 fileid)
return ino; return ino;
} }
int nfs_drop_inode(struct inode *inode)
{
return NFS_STALE(inode) || generic_drop_inode(inode);
}
EXPORT_SYMBOL_GPL(nfs_drop_inode);
void nfs_clear_inode(struct inode *inode) void nfs_clear_inode(struct inode *inode)
{ {
/* /*

View File

@ -296,6 +296,7 @@ extern struct workqueue_struct *nfsiod_workqueue;
extern struct inode *nfs_alloc_inode(struct super_block *sb); extern struct inode *nfs_alloc_inode(struct super_block *sb);
extern void nfs_destroy_inode(struct inode *); extern void nfs_destroy_inode(struct inode *);
extern int nfs_write_inode(struct inode *, struct writeback_control *); extern int nfs_write_inode(struct inode *, struct writeback_control *);
extern int nfs_drop_inode(struct inode *);
extern void nfs_clear_inode(struct inode *); extern void nfs_clear_inode(struct inode *);
extern void nfs_evict_inode(struct inode *); extern void nfs_evict_inode(struct inode *);
void nfs_zap_acl_cache(struct inode *inode); void nfs_zap_acl_cache(struct inode *inode);

View File

@ -51,6 +51,7 @@ static const struct super_operations nfs4_sops = {
.alloc_inode = nfs_alloc_inode, .alloc_inode = nfs_alloc_inode,
.destroy_inode = nfs_destroy_inode, .destroy_inode = nfs_destroy_inode,
.write_inode = nfs4_write_inode, .write_inode = nfs4_write_inode,
.drop_inode = nfs_drop_inode,
.put_super = nfs_put_super, .put_super = nfs_put_super,
.statfs = nfs_statfs, .statfs = nfs_statfs,
.evict_inode = nfs4_evict_inode, .evict_inode = nfs4_evict_inode,

View File

@ -308,6 +308,7 @@ const struct super_operations nfs_sops = {
.alloc_inode = nfs_alloc_inode, .alloc_inode = nfs_alloc_inode,
.destroy_inode = nfs_destroy_inode, .destroy_inode = nfs_destroy_inode,
.write_inode = nfs_write_inode, .write_inode = nfs_write_inode,
.drop_inode = nfs_drop_inode,
.put_super = nfs_put_super, .put_super = nfs_put_super,
.statfs = nfs_statfs, .statfs = nfs_statfs,
.evict_inode = nfs_evict_inode, .evict_inode = nfs_evict_inode,