kernfs: don't set dentry->d_fsdata
When working on adding exportfs operations in kernfs, I found it's hard to initialize dentry->d_fsdata in the exportfs operations. Looks there is no way to do it without race condition. Look at the kernfs code closely, there is no point to set dentry->d_fsdata. inode->i_private already points to kernfs_node, and we can get inode from a dentry. So this patch just delete the d_fsdata usage. Acked-by: Tejun Heo <tj@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
@@ -70,6 +70,13 @@ struct kernfs_super_info {
|
||||
};
|
||||
#define kernfs_info(SB) ((struct kernfs_super_info *)(SB->s_fs_info))
|
||||
|
||||
static inline struct kernfs_node *kernfs_dentry_node(struct dentry *dentry)
|
||||
{
|
||||
if (d_really_is_negative(dentry))
|
||||
return NULL;
|
||||
return d_inode(dentry)->i_private;
|
||||
}
|
||||
|
||||
extern const struct super_operations kernfs_sops;
|
||||
extern struct kmem_cache *kernfs_node_cache;
|
||||
|
||||
|
Reference in New Issue
Block a user