internal.h (16419098e8b301417173d8d2cbfa94a56ac9900b) internal.h (5790b1fb3d672d9a1fe3881a7181dfdbe741568f)
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _TRACEFS_INTERNAL_H
3#define _TRACEFS_INTERNAL_H
4
5enum {
6 TRACEFS_EVENT_INODE = BIT(1),
7 TRACEFS_EVENT_TOP_INODE = BIT(2),
8};
9
10struct tracefs_inode {
11 unsigned long flags;
12 void *private;
13 struct inode vfs_inode;
14};
15
1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _TRACEFS_INTERNAL_H
3#define _TRACEFS_INTERNAL_H
4
5enum {
6 TRACEFS_EVENT_INODE = BIT(1),
7 TRACEFS_EVENT_TOP_INODE = BIT(2),
8};
9
10struct tracefs_inode {
11 unsigned long flags;
12 void *private;
13 struct inode vfs_inode;
14};
15
16/*
17 * struct eventfs_inode - hold the properties of the eventfs directories.
18 * @list: link list into the parent directory
19 * @entries: the array of entries representing the files in the directory
20 * @name: the name of the directory to create
21 * @children: link list into the child eventfs_inode
22 * @dentry: the dentry of the directory
23 * @d_parent: pointer to the parent's dentry
24 * @d_children: The array of dentries to represent the files when created
25 * @data: The private data to pass to the callbacks
26 * @nr_entries: The number of items in @entries
27 */
28struct eventfs_inode {
29 struct list_head list;
30 const struct eventfs_entry *entries;
31 const char *name;
32 struct list_head children;
33 struct dentry *dentry;
34 struct dentry *d_parent;
35 struct dentry **d_children;
36 void *data;
37 /*
38 * Union - used for deletion
39 * @del_list: list of eventfs_inode to delete
40 * @rcu: eventfs_indoe to delete in RCU
41 * @is_freed: node is freed if one of the above is set
42 */
43 union {
44 struct list_head del_list;
45 struct rcu_head rcu;
46 unsigned long is_freed;
47 };
48 int nr_entries;
49};
50
16static inline struct tracefs_inode *get_tracefs(const struct inode *inode)
17{
18 return container_of(inode, struct tracefs_inode, vfs_inode);
19}
20
21struct dentry *tracefs_start_creating(const char *name, struct dentry *parent);
22struct dentry *tracefs_end_creating(struct dentry *dentry);
23struct dentry *tracefs_failed_creating(struct dentry *dentry);
24struct inode *tracefs_get_inode(struct super_block *sb);
25struct dentry *eventfs_start_creating(const char *name, struct dentry *parent);
26struct dentry *eventfs_failed_creating(struct dentry *dentry);
27struct dentry *eventfs_end_creating(struct dentry *dentry);
51static inline struct tracefs_inode *get_tracefs(const struct inode *inode)
52{
53 return container_of(inode, struct tracefs_inode, vfs_inode);
54}
55
56struct dentry *tracefs_start_creating(const char *name, struct dentry *parent);
57struct dentry *tracefs_end_creating(struct dentry *dentry);
58struct dentry *tracefs_failed_creating(struct dentry *dentry);
59struct inode *tracefs_get_inode(struct super_block *sb);
60struct dentry *eventfs_start_creating(const char *name, struct dentry *parent);
61struct dentry *eventfs_failed_creating(struct dentry *dentry);
62struct dentry *eventfs_end_creating(struct dentry *dentry);
28void eventfs_set_ef_status_free(struct tracefs_inode *ti, struct dentry *dentry);
63void eventfs_set_ei_status_free(struct tracefs_inode *ti, struct dentry *dentry);
29
30#endif /* _TRACEFS_INTERNAL_H */
64
65#endif /* _TRACEFS_INTERNAL_H */