tracing: Updates for v6.7
Steven Rostedt
maintainercover tracing: Updates for v6.7
git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace/for-next
Head SHA1: 5ddd8baa4857709b4e5d84b376d735152851955b
Steven Rostedt (Google) (2):
eventfs: Use eventfs_remove_events_dir()
tracing: Make system_callback() function static
----
fs/tracefs/event_inode.c | 19 +++++++------------ include/linux/tracefs.h | 1 + kernel/trace/trace_events.c | 4 ++-- 3 files changed, 10 insertions(+), 14 deletions(-)
Steven Rostedt
maintainerPATCH 1/2 eventfs: Use eventfs_remove_events_dir()
From: "Steven Rostedt (Google)" <[email protected]>
The update to removing the eventfs_file changed the way the events top level directory was handled. Instead of returning a dentry, it now returns the eventfs_inode. In this changed, the removing of the events top level directory is not much different than removing any of the other directories. Because of this, the removal just called eventfs_remove_dir() instead of eventfs_remove_events_dir().
Although eventfs_remove_dir() does the clean up, it misses out on the dget() of the ei->dentry done in eventfs_create_events_dir(). It makes more sense to match eventfs_create_events_dir() with a specific function eventfs_remove_events_dir() and this specific function can then perform the dput() to the dentry that had the dget() when it was created.
--- fs/tracefs/event_inode.c | 19 +++++++------------ include/linux/tracefs.h | 1 + kernel/trace/trace_events.c | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-)
fs/tracefs/event_inode.c +7 -12
@@ -901,22 +901,17 @@ void eventfs_remove_dir(struct eventfs_inode *ei) }/** -* eventfs_remove_events_dir - remove eventfs dir or file from list -* @dentry: events's dentry to be removed. +* eventfs_remove_events_dir - remove the top level eventfs directory +* @ei: the event_inode returned by eventfs_create_events_dir(). * -* This function remove events main directory +* This function removes the events main directory */ -void eventfs_remove_events_dir (struct dentry *dentry) +void eventfs_remove_events_dir (struct eventfs_inode *ei) { -struct tracefs_inode *ti; - -if (!dentry || !dentry->d_inode) -return ; +struct dentry *dentry = ei->dentry; - ti =get_tracefs (dentry->d_inode); -if (!ti || !(ti->flags &TRACEFS_EVENT_INODE )) -return ; +eventfs_remove_dir (ei); -d_invalidate (dentry); +/* Matches the dget() from eventfs_create_events_dir() */ dput (dentry); }
include/linux/tracefs.h +1 -0
@@ -41,6 +41,7 @@ struct eventfs_inode *eventfs_create_dir(const char *name, struct eventfs_inodeconst struct eventfs_entry *entries, int size, void *data); +void eventfs_remove_events_dir (struct eventfs_inode *ei);void eventfs_remove_dir (struct eventfs_inode *ei); struct dentry *tracefs_create_file(const char *name, umode_t mode,
kernel/trace/trace_events.c +1 -1
@@ -3872,7 +3872,7 @@ int event_trace_del_tracer(struct trace_array *tr)down_write (&trace_event_sem);__trace_remove_event_dirs (tr); -eventfs_remove_dir (tr->event_dir); +eventfs_remove_events_dir (tr->event_dir);up_write (&trace_event_sem); tr->event_dir =NULL ;
Signature · 1 line
2.40.1
Steven Rostedt
maintainerPATCH 2/2 tracing: Make system_callback() function static
In reply to Steven RostedtFrom: "Steven Rostedt (Google)" <[email protected]>
The system_callback() function in trace_events.c is only used within that file. The "static" annotation was missed.
--- kernel/trace/trace_events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/trace/trace_events.c +1 -1
@@ -2282,7 +2282,7 @@ create_new_subsystem(const char *name)return NULL ; } -int system_callback (const char *name,umode_t *mode,void **data, +static int system_callback (const char *name,umode_t *mode,void **data,const struct file_operations **fops) {if (strcmp (name,"filter" ) ==0 )
Signature · 1 line
2.40.1