Thread (10 messages) flat view 10 messages, 3 authors, 2024-08-07

Re: [PATCH 2/2] tracefs: Don't overlay 'struct inode'

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2024-08-07 13:34:56
Also in: lkml
Subsystem: filesystems (vfs and infrastructure), the rest, tracing · Maintainers: Alexander Viro, Christian Brauner, Linus Torvalds, Steven Rostedt, Masami Hiramatsu

On Wed,  7 Aug 2024 13:51:39 +0200
Mathias Krause [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h
index f704d8348357..a7769857962a 100644
--- a/fs/tracefs/internal.h
+++ b/fs/tracefs/internal.h
@@ -10,10 +10,8 @@ enum {
 };
 
 struct tracefs_inode {
-	union {
-		struct inode            vfs_inode;
-		struct rcu_head		rcu;
-	};
+	struct inode		vfs_inode;
+	struct rcu_head		rcu;
I rather not make this structure any bigger for the rcu element that is not
used until freed.
 	/* The below gets initialized with memset_after(ti, 0, vfs_inode) */
 	struct list_head	list;
 	unsigned long           flags;
Perhaps:
diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h
index f704d8348357..ab6d6c3d835d 100644
--- a/fs/tracefs/internal.h
+++ b/fs/tracefs/internal.h
@@ -10,12 +10,12 @@ enum {
 };
 
 struct tracefs_inode {
+	struct inode            vfs_inode;
+	/* The below gets initialized with memset_after(ti, 0, vfs_inode) */
 	union {
-		struct inode            vfs_inode;
+		struct list_head	list;
 		struct rcu_head		rcu;
 	};
-	/* The below gets initialized with memset_after(ti, 0, vfs_inode) */
-	struct list_head	list;
 	unsigned long           flags;
 	void                    *private;
 };


-- Steve
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help