out_free:
/* No need to unlock it, because it is disappeared. */
- free_dentry_private_data(UNIONFS_D(dentry));
- dentry->d_fsdata = NULL; /* just to be safe */
+ free_dentry_private_data(dentry);
out:
return;
kmem_cache_destroy(unionfs_dentry_cachep);
}
-void free_dentry_private_data(struct unionfs_dentry_info *udi)
+void free_dentry_private_data(struct dentry *dentry)
{
- if (!udi)
+ if (!dentry || !dentry->d_fsdata)
return;
- kmem_cache_free(unionfs_dentry_cachep, udi);
+ kmem_cache_free(unionfs_dentry_cachep, dentry->d_fsdata);
+ dentry->d_fsdata = NULL;
}
static inline int __realloc_dentry_private_data(struct dentry *dentry)
return 0;
kfree(UNIONFS_D(dentry)->lower_paths);
- free_dentry_private_data(UNIONFS_D(dentry));
- dentry->d_fsdata = NULL;
+ free_dentry_private_data(dentry);
return -ENOMEM;
}
out_freedpd:
if (UNIONFS_D(sb->s_root)) {
kfree(UNIONFS_D(sb->s_root)->lower_paths);
- free_dentry_private_data(UNIONFS_D(sb->s_root));
+ free_dentry_private_data(sb->s_root);
}
dput(sb->s_root);
extern int realloc_dentry_private_data(struct dentry *dentry);
extern int new_dentry_private_data(struct dentry *dentry);
-extern void free_dentry_private_data(struct unionfs_dentry_info *udi);
+extern void free_dentry_private_data(struct dentry *dentry);
extern void update_bstart(struct dentry *dentry);
/*