Linux kernel mirror (for testing)
git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel
os
linux
1/*
2 * The proc filesystem constants/structures
3 */
4#ifndef _LINUX_PROC_FS_H
5#define _LINUX_PROC_FS_H
6
7#include <linux/types.h>
8#include <linux/fs.h>
9
10struct proc_dir_entry;
11
12#ifdef CONFIG_PROC_FS
13
14extern void proc_root_init(void);
15extern void proc_flush_task(struct task_struct *);
16
17extern struct proc_dir_entry *proc_symlink(const char *,
18 struct proc_dir_entry *, const char *);
19extern struct proc_dir_entry *proc_mkdir(const char *, struct proc_dir_entry *);
20extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
21 struct proc_dir_entry *, void *);
22extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t,
23 struct proc_dir_entry *);
24struct proc_dir_entry *proc_create_mount_point(const char *name);
25
26extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
27 struct proc_dir_entry *,
28 const struct file_operations *,
29 void *);
30
31struct proc_dir_entry *proc_create(const char *name, umode_t mode, struct proc_dir_entry *parent, const struct file_operations *proc_fops);
32extern void proc_set_size(struct proc_dir_entry *, loff_t);
33extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
34extern void *PDE_DATA(const struct inode *);
35extern void *proc_get_parent_data(const struct inode *);
36extern void proc_remove(struct proc_dir_entry *);
37extern void remove_proc_entry(const char *, struct proc_dir_entry *);
38extern int remove_proc_subtree(const char *, struct proc_dir_entry *);
39
40#else /* CONFIG_PROC_FS */
41
42static inline void proc_root_init(void)
43{
44}
45
46static inline void proc_flush_task(struct task_struct *task)
47{
48}
49
50static inline struct proc_dir_entry *proc_symlink(const char *name,
51 struct proc_dir_entry *parent,const char *dest) { return NULL;}
52static inline struct proc_dir_entry *proc_mkdir(const char *name,
53 struct proc_dir_entry *parent) {return NULL;}
54static inline struct proc_dir_entry *proc_create_mount_point(const char *name) { return NULL; }
55static inline struct proc_dir_entry *proc_mkdir_data(const char *name,
56 umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; }
57static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
58 umode_t mode, struct proc_dir_entry *parent) { return NULL; }
59#define proc_create(name, mode, parent, proc_fops) ({NULL;})
60#define proc_create_data(name, mode, parent, proc_fops, data) ({NULL;})
61
62static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {}
63static inline void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid) {}
64static inline void *PDE_DATA(const struct inode *inode) {BUG(); return NULL;}
65static inline void *proc_get_parent_data(const struct inode *inode) { BUG(); return NULL; }
66
67static inline void proc_remove(struct proc_dir_entry *de) {}
68#define remove_proc_entry(name, parent) do {} while (0)
69static inline int remove_proc_subtree(const char *name, struct proc_dir_entry *parent) { return 0; }
70
71#endif /* CONFIG_PROC_FS */
72
73struct net;
74
75static inline struct proc_dir_entry *proc_net_mkdir(
76 struct net *net, const char *name, struct proc_dir_entry *parent)
77{
78 return proc_mkdir_data(name, 0, parent, net);
79}
80
81struct ns_common;
82int open_related_ns(struct ns_common *ns,
83 struct ns_common *(*get_ns)(struct ns_common *ns));
84
85#endif /* _LINUX_PROC_FS_H */