Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[linux-2.6.git] / include / linux / proc_fs.h
blob608e60a74c3c124293bb3db038d3a1e8ba804432
1 /*
2 * The proc filesystem constants/structures
3 */
4 #ifndef _LINUX_PROC_FS_H
5 #define _LINUX_PROC_FS_H
7 #include <linux/types.h>
8 #include <linux/fs.h>
10 struct proc_dir_entry;
12 #ifdef CONFIG_PROC_FS
14 extern void proc_root_init(void);
15 extern void proc_flush_task(struct task_struct *);
17 extern struct proc_dir_entry *proc_symlink(const char *,
18 struct proc_dir_entry *, const char *);
19 extern struct proc_dir_entry *proc_mkdir(const char *, struct proc_dir_entry *);
20 extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
21 struct proc_dir_entry *, void *);
22 extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t,
23 struct proc_dir_entry *);
25 extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
26 struct proc_dir_entry *,
27 const struct file_operations *,
28 void *);
30 static inline struct proc_dir_entry *proc_create(
31 const char *name, umode_t mode, struct proc_dir_entry *parent,
32 const struct file_operations *proc_fops)
34 return proc_create_data(name, mode, parent, proc_fops, NULL);
37 extern void proc_set_size(struct proc_dir_entry *, loff_t);
38 extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
39 extern void *PDE_DATA(const struct inode *);
40 extern void *proc_get_parent_data(const struct inode *);
41 extern void proc_remove(struct proc_dir_entry *);
42 extern void remove_proc_entry(const char *, struct proc_dir_entry *);
43 extern int remove_proc_subtree(const char *, struct proc_dir_entry *);
45 #else /* CONFIG_PROC_FS */
47 static inline void proc_flush_task(struct task_struct *task)
51 static inline struct proc_dir_entry *proc_symlink(const char *name,
52 struct proc_dir_entry *parent,const char *dest) { return NULL;}
53 static inline struct proc_dir_entry *proc_mkdir(const char *name,
54 struct proc_dir_entry *parent) {return NULL;}
55 static inline struct proc_dir_entry *proc_mkdir_data(const char *name,
56 umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; }
57 static 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;})
62 static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {}
63 static inline void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid) {}
64 static inline void *PDE_DATA(const struct inode *inode) {BUG(); return NULL;}
65 static inline void *proc_get_parent_data(const struct inode *inode) { BUG(); return NULL; }
67 static inline void proc_remove(struct proc_dir_entry *de) {}
68 #define remove_proc_entry(name, parent) do {} while (0)
69 static inline int remove_proc_subtree(const char *name, struct proc_dir_entry *parent) { return 0; }
71 #endif /* CONFIG_PROC_FS */
73 static inline struct proc_dir_entry *proc_net_mkdir(
74 struct net *net, const char *name, struct proc_dir_entry *parent)
76 return proc_mkdir_data(name, 0, parent, net);
79 #endif /* _LINUX_PROC_FS_H */