tracefs: use d_splice_alias() in ->lookup() instances
d_add() is not wrong there (inodes are freshly allocated), but d_splice_alias() is more idiomatic. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
1 parent
e43ffb69e0
commit
b4b559ac05
1 file changed
+2
-4
@@ -389,8 +389,7 @@ static struct dentry *lookup_file(struct eventfs_inode *parent_ei,
|
||||
// Files have their parent's ei as their fsdata
|
||||
dentry->d_fsdata = get_ei(parent_ei);
|
||||
|
||||
d_add(dentry, inode);
|
||||
return NULL;
|
||||
return d_splice_alias(inode, dentry);
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -420,8 +419,7 @@ static struct dentry *lookup_dir_entry(struct dentry *dentry,
|
||||
|
||||
dentry->d_fsdata = get_ei(ei);
|
||||
|
||||
d_add(dentry, inode);
|
||||
return NULL;
|
||||
return d_splice_alias(inode, dentry);
|
||||
}
|
||||
|
||||
static inline struct eventfs_inode *init_ei(struct eventfs_inode *ei, const char *name)
|
||||
|
||||
Reference in new issue
Block a user