aboutsummaryrefslogtreecommitdiffstats
path: root/fs/inode.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-08-07 13:38:29 -0400
committerChristoph Hellwig <hch@brick.lst.de>2009-08-07 13:38:29 -0400
commit2e00c97e2c1d2ffc9e26252ca26b237678b0b772 (patch)
treee2c65f473e079c4b6027f7f8b7224febe7483884 /fs/inode.c
parent54e346215e4fe2ca8c94c54e546cc61902060510 (diff)
vfs: add __destroy_inode
When we want to tear down an inode that lost the add to the cache race in XFS we must not call into ->destroy_inode because that would delete the inode that won the race from the inode cache radix tree. This patch provides the __destroy_inode helper needed to fix this, the actual fix will be in th next patch. As XFS was the only reason destroy_inode was exported we shift the export to the new __destroy_inode. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Eric Sandeen <sandeen@sandeen.net>
Diffstat (limited to 'fs/inode.c')
-rw-r--r--fs/inode.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/inode.c b/fs/inode.c
index af2c05235cc8..ae7b67e48661 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -229,7 +229,7 @@ static struct inode *alloc_inode(struct super_block *sb)
229 return inode; 229 return inode;
230} 230}
231 231
232void destroy_inode(struct inode *inode) 232void __destroy_inode(struct inode *inode)
233{ 233{
234 BUG_ON(inode_has_buffers(inode)); 234 BUG_ON(inode_has_buffers(inode));
235 ima_inode_free(inode); 235 ima_inode_free(inode);
@@ -241,13 +241,17 @@ void destroy_inode(struct inode *inode)
241 if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED) 241 if (inode->i_default_acl && inode->i_default_acl != ACL_NOT_CACHED)
242 posix_acl_release(inode->i_default_acl); 242 posix_acl_release(inode->i_default_acl);
243#endif 243#endif
244}
245EXPORT_SYMBOL(__destroy_inode);
246
247void destroy_inode(struct inode *inode)
248{
249 __destroy_inode(inode);
244 if (inode->i_sb->s_op->destroy_inode) 250 if (inode->i_sb->s_op->destroy_inode)
245 inode->i_sb->s_op->destroy_inode(inode); 251 inode->i_sb->s_op->destroy_inode(inode);
246 else 252 else
247 kmem_cache_free(inode_cachep, (inode)); 253 kmem_cache_free(inode_cachep, (inode));
248} 254}
249EXPORT_SYMBOL(destroy_inode);
250
251 255
252/* 256/*
253 * These are initializations that only need to be done 257 * These are initializations that only need to be done