aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r--fs/nilfs2/super.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
index f804d41ec9d3..e2dcc9c733f7 100644
--- a/fs/nilfs2/super.c
+++ b/fs/nilfs2/super.c
@@ -162,10 +162,13 @@ struct inode *nilfs_alloc_inode(struct super_block *sb)
162 return &ii->vfs_inode; 162 return &ii->vfs_inode;
163} 163}
164 164
165void nilfs_destroy_inode(struct inode *inode) 165static void nilfs_i_callback(struct rcu_head *head)
166{ 166{
167 struct inode *inode = container_of(head, struct inode, i_rcu);
167 struct nilfs_mdt_info *mdi = NILFS_MDT(inode); 168 struct nilfs_mdt_info *mdi = NILFS_MDT(inode);
168 169
170 INIT_LIST_HEAD(&inode->i_dentry);
171
169 if (mdi) { 172 if (mdi) {
170 kfree(mdi->mi_bgl); /* kfree(NULL) is safe */ 173 kfree(mdi->mi_bgl); /* kfree(NULL) is safe */
171 kfree(mdi); 174 kfree(mdi);
@@ -173,6 +176,11 @@ void nilfs_destroy_inode(struct inode *inode)
173 kmem_cache_free(nilfs_inode_cachep, NILFS_I(inode)); 176 kmem_cache_free(nilfs_inode_cachep, NILFS_I(inode));
174} 177}
175 178
179void nilfs_destroy_inode(struct inode *inode)
180{
181 call_rcu(&inode->i_rcu, nilfs_i_callback);
182}
183
176static int nilfs_sync_super(struct nilfs_sb_info *sbi, int flag) 184static int nilfs_sync_super(struct nilfs_sb_info *sbi, int flag)
177{ 185{
178 struct the_nilfs *nilfs = sbi->s_nilfs; 186 struct the_nilfs *nilfs = sbi->s_nilfs;
@@ -838,7 +846,7 @@ static int nilfs_attach_snapshot(struct super_block *s, __u64 cno,
838 846
839static int nilfs_tree_was_touched(struct dentry *root_dentry) 847static int nilfs_tree_was_touched(struct dentry *root_dentry)
840{ 848{
841 return atomic_read(&root_dentry->d_count) > 1; 849 return root_dentry->d_count > 1;
842} 850}
843 851
844/** 852/**