From nobody Sun Feb 8 11:45:00 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9B686C001DF for ; Mon, 31 Jul 2023 23:17:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231959AbjGaXRi (ORCPT ); Mon, 31 Jul 2023 19:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231906AbjGaXRX (ORCPT ); Mon, 31 Jul 2023 19:17:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4243D1999 for ; Mon, 31 Jul 2023 16:17:15 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D575761362 for ; Mon, 31 Jul 2023 23:17:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1753C433C7; Mon, 31 Jul 2023 23:17:07 +0000 (UTC) Received: from rostedt by gandalf with local (Exim 4.96) (envelope-from ) id 1qQc8Q-003fOB-2C; Mon, 31 Jul 2023 19:17:06 -0400 Message-ID: <20230731231706.499969864@goodmis.org> User-Agent: quilt/0.66 Date: Mon, 31 Jul 2023 19:16:42 -0400 From: Steven Rostedt To: linux-kernel@vger.kernel.org Cc: Masami Hiramatsu , Mark Rutland , Andrew Morton , Ajay Kaher , Ching-lin Yu Subject: [for-next][PATCH 08/15] tracefs: Rename and export some tracefs functions References: <20230731231634.031452225@goodmis.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Ajay Kaher Export a few tracefs functions that will be needed by the eventfs dynamic file system. Rename them to start with "tracefs_" to keep with the name space. start_creating -> tracefs_start_creating failed_creating -> tracefs_failed_creating end_creating -> tracefs_end_creating Link: https://lkml.kernel.org/r/1690568452-46553-4-git-send-email-akaher@vm= ware.com Signed-off-by: Ajay Kaher Co-developed-by: Steven Rostedt (VMware) Signed-off-by: Steven Rostedt (VMware) Tested-by: Ching-lin Yu Signed-off-by: Steven Rostedt (Google) --- fs/tracefs/inode.c | 20 ++++++++++---------- fs/tracefs/internal.h | 5 +++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c index 2508944cc4d8..4acc4b4dfd22 100644 --- a/fs/tracefs/inode.c +++ b/fs/tracefs/inode.c @@ -147,7 +147,7 @@ static const struct inode_operations tracefs_dir_inode_= operations =3D { .rmdir =3D tracefs_syscall_rmdir, }; =20 -static struct inode *tracefs_get_inode(struct super_block *sb) +struct inode *tracefs_get_inode(struct super_block *sb) { struct inode *inode =3D new_inode(sb); if (inode) { @@ -422,7 +422,7 @@ static struct file_system_type trace_fs_type =3D { }; MODULE_ALIAS_FS("tracefs"); =20 -static struct dentry *start_creating(const char *name, struct dentry *pare= nt) +struct dentry *tracefs_start_creating(const char *name, struct dentry *par= ent) { struct dentry *dentry; int error; @@ -460,7 +460,7 @@ static struct dentry *start_creating(const char *name, = struct dentry *parent) return dentry; } =20 -static struct dentry *failed_creating(struct dentry *dentry) +struct dentry *tracefs_failed_creating(struct dentry *dentry) { inode_unlock(d_inode(dentry->d_parent)); dput(dentry); @@ -468,7 +468,7 @@ static struct dentry *failed_creating(struct dentry *de= ntry) return NULL; } =20 -static struct dentry *end_creating(struct dentry *dentry) +struct dentry *tracefs_end_creating(struct dentry *dentry) { inode_unlock(d_inode(dentry->d_parent)); return dentry; @@ -513,14 +513,14 @@ struct dentry *tracefs_create_file(const char *name, = umode_t mode, if (!(mode & S_IFMT)) mode |=3D S_IFREG; BUG_ON(!S_ISREG(mode)); - dentry =3D start_creating(name, parent); + dentry =3D tracefs_start_creating(name, parent); =20 if (IS_ERR(dentry)) return NULL; =20 inode =3D tracefs_get_inode(dentry->d_sb); if (unlikely(!inode)) - return failed_creating(dentry); + return tracefs_failed_creating(dentry); =20 inode->i_mode =3D mode; inode->i_fop =3D fops ? fops : &tracefs_file_operations; @@ -529,13 +529,13 @@ struct dentry *tracefs_create_file(const char *name, = umode_t mode, inode->i_gid =3D d_inode(dentry->d_parent)->i_gid; d_instantiate(dentry, inode); fsnotify_create(d_inode(dentry->d_parent), dentry); - return end_creating(dentry); + return tracefs_end_creating(dentry); } =20 static struct dentry *__create_dir(const char *name, struct dentry *parent, const struct inode_operations *ops) { - struct dentry *dentry =3D start_creating(name, parent); + struct dentry *dentry =3D tracefs_start_creating(name, parent); struct inode *inode; =20 if (IS_ERR(dentry)) @@ -543,7 +543,7 @@ static struct dentry *__create_dir(const char *name, st= ruct dentry *parent, =20 inode =3D tracefs_get_inode(dentry->d_sb); if (unlikely(!inode)) - return failed_creating(dentry); + return tracefs_failed_creating(dentry); =20 /* Do not set bits for OTH */ inode->i_mode =3D S_IFDIR | S_IRWXU | S_IRUSR| S_IRGRP | S_IXUSR | S_IXGR= P; @@ -557,7 +557,7 @@ static struct dentry *__create_dir(const char *name, st= ruct dentry *parent, d_instantiate(dentry, inode); inc_nlink(d_inode(dentry->d_parent)); fsnotify_mkdir(d_inode(dentry->d_parent), dentry); - return end_creating(dentry); + return tracefs_end_creating(dentry); } =20 /** diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h index 954ea005632b..7dfb7ebc1c3f 100644 --- a/fs/tracefs/internal.h +++ b/fs/tracefs/internal.h @@ -12,4 +12,9 @@ static inline struct tracefs_inode *get_tracefs(const str= uct inode *inode) { return container_of(inode, struct tracefs_inode, vfs_inode); } + +struct dentry *tracefs_start_creating(const char *name, struct dentry *par= ent); +struct dentry *tracefs_end_creating(struct dentry *dentry); +struct dentry *tracefs_failed_creating(struct dentry *dentry); +struct inode *tracefs_get_inode(struct super_block *sb); #endif /* _TRACEFS_INTERNAL_H */ --=20 2.40.1