Skip to content

Commit 62d65ca

Browse files
committed
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/[email protected] Cc: Ajay Kaher <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Andrew Morton <[email protected]> Reviewed-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 020010f commit 62d65ca

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

fs/tracefs/event_inode.c

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -274,28 +274,11 @@ static void free_ei(struct eventfs_inode *ei)
274274
*/
275275
void eventfs_set_ei_status_free(struct tracefs_inode *ti, struct dentry *dentry)
276276
{
277-
struct tracefs_inode *ti_parent;
278277
struct eventfs_inode *ei;
279278
int i;
280279

281-
/* The top level events directory may be freed by this */
282-
if (unlikely(ti->flags & TRACEFS_EVENT_TOP_INODE)) {
283-
mutex_lock(&eventfs_mutex);
284-
ei = ti->private;
285-
/* Nothing should access this, but just in case! */
286-
ti->private = NULL;
287-
mutex_unlock(&eventfs_mutex);
288-
289-
free_ei(ei);
290-
return;
291-
}
292-
293280
mutex_lock(&eventfs_mutex);
294281

295-
ti_parent = get_tracefs(dentry->d_parent->d_inode);
296-
if (!ti_parent || !(ti_parent->flags & TRACEFS_EVENT_INODE))
297-
goto out;
298-
299282
ei = dentry->d_fsdata;
300283
if (!ei)
301284
goto out;
@@ -920,6 +903,8 @@ struct eventfs_inode *eventfs_create_events_dir(const char *name, struct dentry
920903
inode->i_op = &eventfs_root_dir_inode_operations;
921904
inode->i_fop = &eventfs_file_operations;
922905

906+
dentry->d_fsdata = ei;
907+
923908
/* directory inodes start off with i_nlink == 2 (for "." entry) */
924909
inc_nlink(inode);
925910
d_instantiate(dentry, inode);

0 commit comments

Comments
 (0)