summaryrefslogtreecommitdiff
path: root/fs/tracefs/internal.h
diff options
context:
space:
mode:
authorAjay Kaher <akaher@vmware.com>2023-07-28 21:20:44 +0300
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-07-31 01:13:33 +0300
commitba37ff75e04be7df5fa19dcd86f81c984294a37b (patch)
tree575ba676531a52002fb820d3f557bc505528aae4 /fs/tracefs/internal.h
parentee41106a12c76f38d0cf82ef17809fa62757151d (diff)
downloadlinux-ba37ff75e04be7df5fa19dcd86f81c984294a37b.tar.xz
eventfs: Implement tracefs_inode_cache
Create a kmem cache of tracefs_inodes. To be more efficient, as there are lots of tracefs inodes, create its own cache. This also allows to see how many tracefs inodes have been created. Add helper functions: tracefs_alloc_inode() tracefs_free_inode() get_tracefs() Link: https://lkml.kernel.org/r/1690568452-46553-3-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>
Diffstat (limited to 'fs/tracefs/internal.h')
-rw-r--r--fs/tracefs/internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h
new file mode 100644
index 000000000000..954ea005632b
--- /dev/null
+++ b/fs/tracefs/internal.h
@@ -0,0 +1,15 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef _TRACEFS_INTERNAL_H
+#define _TRACEFS_INTERNAL_H
+
+struct tracefs_inode {
+ unsigned long flags;
+ void *private;
+ struct inode vfs_inode;
+};
+
+static inline struct tracefs_inode *get_tracefs(const struct inode *inode)
+{
+ return container_of(inode, struct tracefs_inode, vfs_inode);
+}
+#endif /* _TRACEFS_INTERNAL_H */