Skip to content

Commit 264424d

Browse files
committed
eventfs: Restructure eventfs_inode structure to be more condensed
Some of the eventfs_inode structure has holes in it. Rework the structure to be a bit more condensed, and also remove the no longer used llist field. Link: https://lore.kernel.org/linux-trace-kernel/20240201161617.002321438@goodmis.org Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Christian Brauner <brauner@kernel.org> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: Ajay Kaher <ajay.kaher@broadcom.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent 5a49f99 commit 264424d

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

fs/tracefs/internal.h

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,40 +32,37 @@ struct eventfs_attr {
3232
/*
3333
* struct eventfs_inode - hold the properties of the eventfs directories.
3434
* @list: link list into the parent directory
35+
* @rcu: Union with @list for freeing
36+
* @children: link list into the child eventfs_inode
3537
* @entries: the array of entries representing the files in the directory
3638
* @name: the name of the directory to create
37-
* @children: link list into the child eventfs_inode
3839
* @events_dir: the dentry of the events directory
3940
* @entry_attrs: Saved mode and ownership of the @d_children
40-
* @attr: Saved mode and ownership of eventfs_inode itself
4141
* @data: The private data to pass to the callbacks
42+
* @attr: Saved mode and ownership of eventfs_inode itself
4243
* @is_freed: Flag set if the eventfs is on its way to be freed
4344
* Note if is_freed is set, then dentry is corrupted.
45+
* @is_events: Flag set for only the top level "events" directory
4446
* @nr_entries: The number of items in @entries
47+
* @ino: The saved inode number
4548
*/
4649
struct eventfs_inode {
47-
struct kref kref;
48-
struct list_head list;
50+
union {
51+
struct list_head list;
52+
struct rcu_head rcu;
53+
};
54+
struct list_head children;
4955
const struct eventfs_entry *entries;
5056
const char *name;
51-
struct list_head children;
5257
struct dentry *events_dir;
5358
struct eventfs_attr *entry_attrs;
54-
struct eventfs_attr attr;
5559
void *data;
60+
struct eventfs_attr attr;
61+
struct kref kref;
5662
unsigned int is_freed:1;
5763
unsigned int is_events:1;
5864
unsigned int nr_entries:30;
5965
unsigned int ino;
60-
/*
61-
* Union - used for deletion
62-
* @llist: for calling dput() if needed after RCU
63-
* @rcu: eventfs_inode to delete in RCU
64-
*/
65-
union {
66-
struct llist_node llist;
67-
struct rcu_head rcu;
68-
};
6966
};
7067

7168
static inline struct tracefs_inode *get_tracefs(const struct inode *inode)

0 commit comments

Comments
 (0)