mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 16:49:22 +00:00
eventfs: Remove special processing of dput() of events directory
The top level events directory is no longer special with regards to how it should be delete. Remove the extra processing for it in eventfs_set_ei_status_free(). Link: https://lkml.kernel.org/r/20231101172650.340876747@goodmis.org Cc: Ajay Kaher <akaher@vmware.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
parent
020010fbfa
commit
62d65cac11
1 changed files with 2 additions and 17 deletions
|
@ -274,28 +274,11 @@ static void free_ei(struct eventfs_inode *ei)
|
|||
*/
|
||||
void eventfs_set_ei_status_free(struct tracefs_inode *ti, struct dentry *dentry)
|
||||
{
|
||||
struct tracefs_inode *ti_parent;
|
||||
struct eventfs_inode *ei;
|
||||
int i;
|
||||
|
||||
/* The top level events directory may be freed by this */
|
||||
if (unlikely(ti->flags & TRACEFS_EVENT_TOP_INODE)) {
|
||||
mutex_lock(&eventfs_mutex);
|
||||
ei = ti->private;
|
||||
/* Nothing should access this, but just in case! */
|
||||
ti->private = NULL;
|
||||
mutex_unlock(&eventfs_mutex);
|
||||
|
||||
free_ei(ei);
|
||||
return;
|
||||
}
|
||||
|
||||
mutex_lock(&eventfs_mutex);
|
||||
|
||||
ti_parent = get_tracefs(dentry->d_parent->d_inode);
|
||||
if (!ti_parent || !(ti_parent->flags & TRACEFS_EVENT_INODE))
|
||||
goto out;
|
||||
|
||||
ei = dentry->d_fsdata;
|
||||
if (!ei)
|
||||
goto out;
|
||||
|
@ -920,6 +903,8 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry
|
|||
inode->i_op = &eventfs_root_dir_inode_operations;
|
||||
inode->i_fop = &eventfs_file_operations;
|
||||
|
||||
dentry->d_fsdata = ei;
|
||||
|
||||
/* directory inodes start off with i_nlink == 2 (for "." entry) */
|
||||
inc_nlink(inode);
|
||||
d_instantiate(dentry, inode);
|
||||
|
|
Loading…
Reference in a new issue