#include <linux/module.h>
#include <linux/fs.h>
#include <linux/fs_context.h>
#include <linux/fs_parser.h>
#include <linux/kobject.h>
#include <linux/namei.h>
#include <linux/tracefs.h>
#include <linux/fsnotify.h>
#include <linux/security.h>
#include <linux/seq_file.h>
#include <linux/magic.h>
#include <linux/slab.h>
#include "internal.h"
#define TRACEFS_DEFAULT_MODE …
static struct kmem_cache *tracefs_inode_cachep __ro_after_init;
static struct vfsmount *tracefs_mount;
static int tracefs_mount_count;
static bool tracefs_registered;
static DEFINE_SPINLOCK(tracefs_inode_lock);
static LIST_HEAD(tracefs_inodes);
static struct inode *tracefs_alloc_inode(struct super_block *sb)
{ … }
static void tracefs_free_inode(struct inode *inode)
{ … }
static void tracefs_destroy_inode(struct inode *inode)
{ … }
static ssize_t default_read_file(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t default_write_file(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations tracefs_file_operations = …;
static struct tracefs_dir_ops { … } tracefs_ops __ro_after_init;
static char *get_dname(struct dentry *dentry)
{ … }
static int tracefs_syscall_mkdir(struct mnt_idmap *idmap,
struct inode *inode, struct dentry *dentry,
umode_t mode)
{ … }
static int tracefs_syscall_rmdir(struct inode *inode, struct dentry *dentry)
{ … }
static void set_tracefs_inode_owner(struct inode *inode)
{ … }
static int tracefs_permission(struct mnt_idmap *idmap,
struct inode *inode, int mask)
{ … }
static int tracefs_getattr(struct mnt_idmap *idmap,
const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int flags)
{ … }
static int tracefs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
struct iattr *attr)
{ … }
static const struct inode_operations tracefs_instance_dir_inode_operations = …;
static const struct inode_operations tracefs_dir_inode_operations = …;
static const struct inode_operations tracefs_file_inode_operations = …;
struct inode *tracefs_get_inode(struct super_block *sb)
{ … }
struct tracefs_fs_info { … };
enum { … };
static const struct fs_parameter_spec tracefs_param_specs[] = …;
static int tracefs_parse_param(struct fs_context *fc, struct fs_parameter *param)
{ … }
static int tracefs_apply_options(struct super_block *sb, bool remount)
{ … }
static int tracefs_reconfigure(struct fs_context *fc)
{ … }
static int tracefs_show_options(struct seq_file *m, struct dentry *root)
{ … }
static int tracefs_drop_inode(struct inode *inode)
{ … }
static const struct super_operations tracefs_super_operations = …;
static void tracefs_d_release(struct dentry *dentry)
{ … }
static int tracefs_d_revalidate(struct dentry *dentry, unsigned int flags)
{ … }
static const struct dentry_operations tracefs_dentry_operations = …;
static int tracefs_fill_super(struct super_block *sb, struct fs_context *fc)
{ … }
static int tracefs_get_tree(struct fs_context *fc)
{ … }
static void tracefs_free_fc(struct fs_context *fc)
{ … }
static const struct fs_context_operations tracefs_context_ops = …;
static int tracefs_init_fs_context(struct fs_context *fc)
{ … }
static struct file_system_type trace_fs_type = …;
MODULE_ALIAS_FS(…) …;
struct dentry *tracefs_start_creating(const char *name, struct dentry *parent)
{ … }
struct dentry *tracefs_failed_creating(struct dentry *dentry)
{ … }
struct dentry *tracefs_end_creating(struct dentry *dentry)
{ … }
static struct inode *instance_inode(struct dentry *parent, struct inode *inode)
{ … }
struct dentry *tracefs_create_file(const char *name, umode_t mode,
struct dentry *parent, void *data,
const struct file_operations *fops)
{ … }
static struct dentry *__create_dir(const char *name, struct dentry *parent,
const struct inode_operations *ops)
{ … }
struct dentry *tracefs_create_dir(const char *name, struct dentry *parent)
{ … }
__init struct dentry *tracefs_create_instance_dir(const char *name,
struct dentry *parent,
int (*mkdir)(const char *name),
int (*rmdir)(const char *name))
{ … }
static void remove_one(struct dentry *victim)
{ … }
void tracefs_remove(struct dentry *dentry)
{ … }
bool tracefs_initialized(void)
{ … }
static void init_once(void *foo)
{ … }
static int __init tracefs_init(void)
{ … }
core_initcall(tracefs_init);