From nobody Mon Feb 9 23:14:43 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B136133987; Tue, 6 Feb 2024 11:33:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707219211; cv=none; b=PBJwj2CcHbU3Qsc2uLHuio2wxfLDKOR+bISjr4W6Rlgo9TFYRVjihSvNQPCO9wy/ZSEPPlGuAkTZuzsmaFkCu6AKvOjnqKosHhFZXfpFvBTgtTVFl7pnEkOfiHAqhH9IxQjAO7zva6kHUOaX3eaiZ4zcF4f3rgCR1igS6bocz1E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707219211; c=relaxed/simple; bh=JSygnlx6+56lX3XXzthIgsNjw4j5XL26vPR3L/z2tEs=; h=Message-ID:Date:From:To:Cc:Subject:References:MIME-Version: Content-Type; b=aNHJpennxOWhSmaLTPRnq8Jd5WX9qI7JzeT/ryWz5eDLa7h9pLVmzERqmx6kY8LKI0DYF0BrbvzojNd1VImkrhKE6G/gxVYIcHoWH7wJuGRKbtqm0ycDNBlmQa8NM+ERVCzzWx+Hq26FyUAotuibgIGnxb7TJN4M73Gay3Jdxm0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1EEF0C43330; Tue, 6 Feb 2024 11:33:31 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.97) (envelope-from ) id 1rXJiB-00000006aKJ-2Ejb; Tue, 06 Feb 2024 06:33:59 -0500 Message-ID: <20240206113359.393228331@rostedt.homelinux.com> User-Agent: quilt/0.67 Date: Tue, 06 Feb 2024 06:32:06 -0500 From: Steven Rostedt To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Linus Torvalds , Greg Kroah-Hartman , Sasha Levin , Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Christian Brauner , Al Viro , Ajay Kaher Subject: [v6.7][PATCH v2 08/23] eventfs: Have the inodes all for files and directories all be the same References: <20240206113158.822006147@rostedt.homelinux.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Steven Rostedt (Google)" The dentries and inodes are created in the readdir for the sole purpose of getting a consistent inode number. Linus stated that is unnecessary, and that all inodes can have the same inode number. For a virtual file system they are pretty meaningless. Instead use a single unique inode number for all files and one for all directories. Link: https://lore.kernel.org/all/20240116133753.2808d45e@gandalf.local.hom= e/ Link: https://lore.kernel.org/linux-trace-kernel/20240116211353.412180363@g= oodmis.org Cc: Masami Hiramatsu Cc: Mark Rutland Cc: Mathieu Desnoyers Cc: Christian Brauner Cc: Al Viro Cc: Ajay Kaher Suggested-by: Linus Torvalds Signed-off-by: Steven Rostedt (Google) (cherry picked from commit 53c41052ba3121761e6f62a813961164532a214f) --- fs/tracefs/event_inode.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fs/tracefs/event_inode.c b/fs/tracefs/event_inode.c index fdff53d5a1f8..5edf0b96758b 100644 --- a/fs/tracefs/event_inode.c +++ b/fs/tracefs/event_inode.c @@ -32,6 +32,10 @@ */ static DEFINE_MUTEX(eventfs_mutex); =20 +/* Choose something "unique" ;-) */ +#define EVENTFS_FILE_INODE_INO 0x12c4e37 +#define EVENTFS_DIR_INODE_INO 0x134b2f5 + /* * The eventfs_inode (ei) itself is protected by SRCU. It is released from * its parent's list and will have is_freed set (under eventfs_mutex). @@ -352,6 +356,9 @@ static struct dentry *create_file(const char *name, umo= de_t mode, inode->i_fop =3D fop; inode->i_private =3D data; =20 + /* All files will have the same inode number */ + inode->i_ino =3D EVENTFS_FILE_INODE_INO; + ti =3D get_tracefs(inode); ti->flags |=3D TRACEFS_EVENT_INODE; d_instantiate(dentry, inode); @@ -388,6 +395,9 @@ static struct dentry *create_dir(struct eventfs_inode *= ei, struct dentry *parent inode->i_op =3D &eventfs_root_dir_inode_operations; inode->i_fop =3D &eventfs_file_operations; =20 + /* All directories will have the same inode number */ + inode->i_ino =3D EVENTFS_DIR_INODE_INO; + ti =3D get_tracefs(inode); ti->flags |=3D TRACEFS_EVENT_INODE; =20 --=20 2.43.0