NFS: Ensure that we always drop inodes that have been marked as stale
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 14 Dec 2012 19:36:36 +0000 (14:36 -0500)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Fri, 14 Dec 2012 19:36:36 +0000 (14:36 -0500)
There is no need to cache stale inodes.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/inode.c
fs/nfs/internal.h
fs/nfs/nfs4super.c
fs/nfs/super.c

index 117183b1ee09e990662ce61a029ffc3b1f88d7b7..2faae14d89f46e97d76f1e82c85f776426c85816 100644 (file)
@@ -107,6 +107,12 @@ u64 nfs_compat_user_ino64(u64 fileid)
        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)
 {
        /*
index 89c1ee4a432ccd8bf239dbc10cbe2ff725b05db0..f0e6c7df1a072a07313de2a92203260b70f9da52 100644 (file)
@@ -296,6 +296,7 @@ extern struct workqueue_struct *nfsiod_workqueue;
 extern struct inode *nfs_alloc_inode(struct super_block *sb);
 extern void nfs_destroy_inode(struct inode *);
 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_evict_inode(struct inode *);
 void nfs_zap_acl_cache(struct inode *inode);
index bd61221ad2c5542b08f42249d10285c159f66b1d..84d2e9e2f313b7d9e64a260f79a66ce83b377f92 100644 (file)
@@ -51,6 +51,7 @@ static const struct super_operations nfs4_sops = {
        .alloc_inode    = nfs_alloc_inode,
        .destroy_inode  = nfs_destroy_inode,
        .write_inode    = nfs4_write_inode,
+       .drop_inode     = nfs_drop_inode,
        .put_super      = nfs_put_super,
        .statfs         = nfs_statfs,
        .evict_inode    = nfs4_evict_inode,
index e12cea4b36a53a448d57c72bcfd4298924597f79..aa5315bb3666817657e01323e84cb36c8c9f0078 100644 (file)
@@ -308,6 +308,7 @@ const struct super_operations nfs_sops = {
        .alloc_inode    = nfs_alloc_inode,
        .destroy_inode  = nfs_destroy_inode,
        .write_inode    = nfs_write_inode,
+       .drop_inode     = nfs_drop_inode,
        .put_super      = nfs_put_super,
        .statfs         = nfs_statfs,
        .evict_inode    = nfs_evict_inode,