From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Andrew Morton <akpm@linux-foundation.org>,
Ajay Kaher <akaher@vmware.com>,
Ching-lin Yu <chinglinyu@google.com>
Subject: [for-next][PATCH 08/15] tracefs: Rename and export some tracefs functions
Date: Mon, 31 Jul 2023 19:16:42 -0400 [thread overview]
Message-ID: <20230731231706.499969864@goodmis.org> (raw)
In-Reply-To: <20230731231634.031452225@goodmis.org>
From: Ajay Kaher <akaher@vmware.com>
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@vmware.com
Signed-off-by: Ajay Kaher <akaher@vmware.com>
Co-developed-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Tested-by: Ching-lin Yu <chinglinyu@google.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
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 = {
.rmdir = tracefs_syscall_rmdir,
};
-static struct inode *tracefs_get_inode(struct super_block *sb)
+struct inode *tracefs_get_inode(struct super_block *sb)
{
struct inode *inode = new_inode(sb);
if (inode) {
@@ -422,7 +422,7 @@ static struct file_system_type trace_fs_type = {
};
MODULE_ALIAS_FS("tracefs");
-static struct dentry *start_creating(const char *name, struct dentry *parent)
+struct dentry *tracefs_start_creating(const char *name, struct dentry *parent)
{
struct dentry *dentry;
int error;
@@ -460,7 +460,7 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
return dentry;
}
-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 *dentry)
return NULL;
}
-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 |= S_IFREG;
BUG_ON(!S_ISREG(mode));
- dentry = start_creating(name, parent);
+ dentry = tracefs_start_creating(name, parent);
if (IS_ERR(dentry))
return NULL;
inode = tracefs_get_inode(dentry->d_sb);
if (unlikely(!inode))
- return failed_creating(dentry);
+ return tracefs_failed_creating(dentry);
inode->i_mode = mode;
inode->i_fop = fops ? fops : &tracefs_file_operations;
@@ -529,13 +529,13 @@ struct dentry *tracefs_create_file(const char *name, umode_t mode,
inode->i_gid = 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);
}
static struct dentry *__create_dir(const char *name, struct dentry *parent,
const struct inode_operations *ops)
{
- struct dentry *dentry = start_creating(name, parent);
+ struct dentry *dentry = tracefs_start_creating(name, parent);
struct inode *inode;
if (IS_ERR(dentry))
@@ -543,7 +543,7 @@ static struct dentry *__create_dir(const char *name, struct dentry *parent,
inode = tracefs_get_inode(dentry->d_sb);
if (unlikely(!inode))
- return failed_creating(dentry);
+ return tracefs_failed_creating(dentry);
/* Do not set bits for OTH */
inode->i_mode = S_IFDIR | S_IRWXU | S_IRUSR| S_IRGRP | S_IXUSR | S_IXGRP;
@@ -557,7 +557,7 @@ static struct dentry *__create_dir(const char *name, struct 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);
}
/**
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 struct inode *inode)
{
return container_of(inode, struct tracefs_inode, vfs_inode);
}
+
+struct dentry *tracefs_start_creating(const char *name, struct dentry *parent);
+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 */
--
2.40.1
next prev parent reply other threads:[~2023-07-31 23:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-31 23:16 [for-next][PATCH 00/15] tracing: Updates for v6.6 Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 01/15] tracing: Add back FORTIFY_SOURCE logic to kernel_stack event structure Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 02/15] ring_buffer: Use try_cmpxchg instead of cmpxchg Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 03/15] tracing: Remove unnecessary copying of tr->current_trace Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 04/15] tracing: Add free_trace_iter_content() helper function Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 05/15] tracing: Set actual size after ring buffer resize Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 06/15] tracing: Require all trace events to have a TRACE_SYSTEM Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 07/15] eventfs: Implement tracefs_inode_cache Steven Rostedt
2023-07-31 23:16 ` Steven Rostedt [this message]
2023-07-31 23:16 ` [for-next][PATCH 09/15] eventfs: Implement eventfs dir creation functions Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 10/15] eventfs: Implement eventfs file add functions Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 11/15] eventfs: Implement eventfs lookup, read, open functions Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 12/15] eventfs: Implement functions to create files and dirs when accessed Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 13/15] eventfs: Implement removal of meta data from eventfs Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 14/15] eventfs: Move tracing/events to eventfs Steven Rostedt
2023-07-31 23:16 ` [for-next][PATCH 15/15] test: ftrace: Fix kprobe test for eventfs Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230731231706.499969864@goodmis.org \
--to=rostedt@goodmis.org \
--cc=akaher@vmware.com \
--cc=akpm@linux-foundation.org \
--cc=chinglinyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mhiramat@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®