summaryrefslogtreecommitdiffstats
path: root/fs/nfs/fscache.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/fscache.c')
-rw-r--r--fs/nfs/fscache.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c
index 53507aa96b0b..3800ab6f08fa 100644
--- a/fs/nfs/fscache.c
+++ b/fs/nfs/fscache.c
@@ -114,6 +114,10 @@ void nfs_fscache_get_super_cookie(struct super_block *sb, const char *uniq, int
114 struct rb_node **p, *parent; 114 struct rb_node **p, *parent;
115 int diff; 115 int diff;
116 116
117 nfss->fscache_key = NULL;
118 nfss->fscache = NULL;
119 if (!(nfss->options & NFS_OPTION_FSCACHE))
120 return;
117 if (!uniq) { 121 if (!uniq) {
118 uniq = ""; 122 uniq = "";
119 ulen = 1; 123 ulen = 1;
@@ -226,10 +230,11 @@ void nfs_fscache_release_super_cookie(struct super_block *sb)
226void nfs_fscache_init_inode(struct inode *inode) 230void nfs_fscache_init_inode(struct inode *inode)
227{ 231{
228 struct nfs_fscache_inode_auxdata auxdata; 232 struct nfs_fscache_inode_auxdata auxdata;
233 struct nfs_server *nfss = NFS_SERVER(inode);
229 struct nfs_inode *nfsi = NFS_I(inode); 234 struct nfs_inode *nfsi = NFS_I(inode);
230 235
231 nfsi->fscache = NULL; 236 nfsi->fscache = NULL;
232 if (!S_ISREG(inode->i_mode)) 237 if (!(nfss->fscache && S_ISREG(inode->i_mode)))
233 return; 238 return;
234 239
235 memset(&auxdata, 0, sizeof(auxdata)); 240 memset(&auxdata, 0, sizeof(auxdata));