mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
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:
parent
e43ffb69e0
commit
b4b559ac05
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user