proc_fs.h (ea77f7a2e8561012cf100c530170f12351c3b53e) proc_fs.h (3864601387cf4196371e3c1897fdffa5228296f9)
1#ifndef _LINUX_PROC_FS_H
2#define _LINUX_PROC_FS_H
3
4#include <linux/slab.h>
5#include <linux/fs.h>
6#include <linux/spinlock.h>
7#include <linux/magic.h>
8#include <asm/atomic.h>

--- 159 unchanged lines hidden (view full) ---

168}
169
170extern struct proc_dir_entry *proc_net_fops_create(struct net *net,
171 const char *name, mode_t mode, const struct file_operations *fops);
172extern void proc_net_remove(struct net *net, const char *name);
173extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
174 struct proc_dir_entry *parent);
175
1#ifndef _LINUX_PROC_FS_H
2#define _LINUX_PROC_FS_H
3
4#include <linux/slab.h>
5#include <linux/fs.h>
6#include <linux/spinlock.h>
7#include <linux/magic.h>
8#include <asm/atomic.h>

--- 159 unchanged lines hidden (view full) ---

168}
169
170extern struct proc_dir_entry *proc_net_fops_create(struct net *net,
171 const char *name, mode_t mode, const struct file_operations *fops);
172extern void proc_net_remove(struct net *net, const char *name);
173extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
174 struct proc_dir_entry *parent);
175
176/* While the {get|set|dup}_mm_exe_file functions are for mm_structs, they are
177 * only needed to implement /proc/<pid>|self/exe so we define them here. */
178extern void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file);
179extern struct file *get_mm_exe_file(struct mm_struct *mm);
180extern void dup_mm_exe_file(struct mm_struct *oldmm, struct mm_struct *newmm);
176extern struct file *proc_ns_fget(int fd);
181
182#else
183
184#define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; })
185static inline void proc_net_remove(struct net *net, const char *name) {}
186
187static inline void proc_flush_task(struct task_struct *task)
188{

--- 34 unchanged lines hidden (view full) ---

223{
224 return 0;
225}
226
227static inline void pid_ns_release_proc(struct pid_namespace *ns)
228{
229}
230
177
178#else
179
180#define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; })
181static inline void proc_net_remove(struct net *net, const char *name) {}
182
183static inline void proc_flush_task(struct task_struct *task)
184{

--- 34 unchanged lines hidden (view full) ---

219{
220 return 0;
221}
222
223static inline void pid_ns_release_proc(struct pid_namespace *ns)
224{
225}
226
231static inline void set_mm_exe_file(struct mm_struct *mm,
232 struct file *new_exe_file)
233{}
234
235static inline struct file *get_mm_exe_file(struct mm_struct *mm)
227static inline struct file *proc_ns_fget(int fd)
236{
228{
237 return NULL;
229 return ERR_PTR(-EINVAL);
238}
239
230}
231
240static inline void dup_mm_exe_file(struct mm_struct *oldmm,
241 struct mm_struct *newmm)
242{}
243
244#endif /* CONFIG_PROC_FS */
245
246#if !defined(CONFIG_PROC_KCORE)
247static inline void
248kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
249{
250}
251#else
252extern void kclist_add(struct kcore_list *, void *, size_t, int type);
253#endif
254
232#endif /* CONFIG_PROC_FS */
233
234#if !defined(CONFIG_PROC_KCORE)
235static inline void
236kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
237{
238}
239#else
240extern void kclist_add(struct kcore_list *, void *, size_t, int type);
241#endif
242
243struct nsproxy;
244struct proc_ns_operations {
245 const char *name;
246 int type;
247 void *(*get)(struct task_struct *task);
248 void (*put)(void *ns);
249 int (*install)(struct nsproxy *nsproxy, void *ns);
250};
251extern const struct proc_ns_operations netns_operations;
252extern const struct proc_ns_operations utsns_operations;
253extern const struct proc_ns_operations ipcns_operations;
254
255union proc_op {
256 int (*proc_get_link)(struct inode *, struct path *);
257 int (*proc_read)(struct task_struct *task, char *page);
258 int (*proc_show)(struct seq_file *m,
259 struct pid_namespace *ns, struct pid *pid,
260 struct task_struct *task);
261};
262
263struct ctl_table_header;
264struct ctl_table;
265
266struct proc_inode {
267 struct pid *pid;
268 int fd;
269 union proc_op op;
270 struct proc_dir_entry *pde;
271 struct ctl_table_header *sysctl;
272 struct ctl_table *sysctl_entry;
255union proc_op {
256 int (*proc_get_link)(struct inode *, struct path *);
257 int (*proc_read)(struct task_struct *task, char *page);
258 int (*proc_show)(struct seq_file *m,
259 struct pid_namespace *ns, struct pid *pid,
260 struct task_struct *task);
261};
262
263struct ctl_table_header;
264struct ctl_table;
265
266struct proc_inode {
267 struct pid *pid;
268 int fd;
269 union proc_op op;
270 struct proc_dir_entry *pde;
271 struct ctl_table_header *sysctl;
272 struct ctl_table *sysctl_entry;
273 void *ns;
274 const struct proc_ns_operations *ns_ops;
273 struct inode vfs_inode;
274};
275
276static inline struct proc_inode *PROC_I(const struct inode *inode)
277{
278 return container_of(inode, struct proc_inode, vfs_inode);
279}
280
281static inline struct proc_dir_entry *PDE(const struct inode *inode)
282{
283 return PROC_I(inode)->pde;
284}
285
286static inline struct net *PDE_NET(struct proc_dir_entry *pde)
287{
288 return pde->parent->data;
289}
290
275 struct inode vfs_inode;
276};
277
278static inline struct proc_inode *PROC_I(const struct inode *inode)
279{
280 return container_of(inode, struct proc_inode, vfs_inode);
281}
282
283static inline struct proc_dir_entry *PDE(const struct inode *inode)
284{
285 return PROC_I(inode)->pde;
286}
287
288static inline struct net *PDE_NET(struct proc_dir_entry *pde)
289{
290 return pde->parent->data;
291}
292
291struct proc_maps_private {
292 struct pid *pid;
293 struct task_struct *task;
294#ifdef CONFIG_MMU
295 struct vm_area_struct *tail_vma;
296#endif
297};
298
299#endif /* _LINUX_PROC_FS_H */
293#endif /* _LINUX_PROC_FS_H */