diff options
Diffstat (limited to 'fs/inode.c')
-rw-r--r-- | fs/inode.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/inode.c b/fs/inode.c index 5039ddf4f0e0..fd57c8371686 100644 --- a/fs/inode.c +++ b/fs/inode.c | |||
@@ -245,13 +245,20 @@ void __destroy_inode(struct inode *inode) | |||
245 | } | 245 | } |
246 | EXPORT_SYMBOL(__destroy_inode); | 246 | EXPORT_SYMBOL(__destroy_inode); |
247 | 247 | ||
248 | static void i_callback(struct rcu_head *head) | ||
249 | { | ||
250 | struct inode *inode = container_of(head, struct inode, i_rcu); | ||
251 | INIT_LIST_HEAD(&inode->i_dentry); | ||
252 | kmem_cache_free(inode_cachep, inode); | ||
253 | } | ||
254 | |||
248 | void destroy_inode(struct inode *inode) | 255 | void destroy_inode(struct inode *inode) |
249 | { | 256 | { |
250 | __destroy_inode(inode); | 257 | __destroy_inode(inode); |
251 | if (inode->i_sb->s_op->destroy_inode) | 258 | if (inode->i_sb->s_op->destroy_inode) |
252 | inode->i_sb->s_op->destroy_inode(inode); | 259 | inode->i_sb->s_op->destroy_inode(inode); |
253 | else | 260 | else |
254 | kmem_cache_free(inode_cachep, (inode)); | 261 | call_rcu(&inode->i_rcu, i_callback); |
255 | } | 262 | } |
256 | 263 | ||
257 | /* | 264 | /* |