Blame view

include/linux/proc_fs.h 3.03 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
  /*
   * The proc filesystem constants/structures
   */
59d8053f1   David Howells   proc: Move non-pu...
4
5
  #ifndef _LINUX_PROC_FS_H
  #define _LINUX_PROC_FS_H
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
6

59d8053f1   David Howells   proc: Move non-pu...
7
8
  #include <linux/types.h>
  #include <linux/fs.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
9

59d8053f1   David Howells   proc: Move non-pu...
10
  struct proc_dir_entry;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
12
  #ifdef CONFIG_PROC_FS
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
13
  extern void proc_root_init(void);
59d8053f1   David Howells   proc: Move non-pu...
14
  extern void proc_flush_task(struct task_struct *);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
15

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
16
17
  extern struct proc_dir_entry *proc_symlink(const char *,
  		struct proc_dir_entry *, const char *);
59d8053f1   David Howells   proc: Move non-pu...
18
  extern struct proc_dir_entry *proc_mkdir(const char *, struct proc_dir_entry *);
270b5ac21   David Howells   proc: Add proc_mk...
19
20
  extern struct proc_dir_entry *proc_mkdir_data(const char *, umode_t,
  					      struct proc_dir_entry *, void *);
59d8053f1   David Howells   proc: Move non-pu...
21
22
23
24
25
26
27
28
29
30
31
  extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t,
  					      struct proc_dir_entry *);
   
  extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
  					       struct proc_dir_entry *,
  					       const struct file_operations *,
  					       void *);
  
  static inline struct proc_dir_entry *proc_create(
  	const char *name, umode_t mode, struct proc_dir_entry *parent,
  	const struct file_operations *proc_fops)
59b743514   Denis V. Lunev   proc: introduce p...
32
33
34
  {
  	return proc_create_data(name, mode, parent, proc_fops, NULL);
  }
59d8053f1   David Howells   proc: Move non-pu...
35

271a15eab   David Howells   proc: Supply PDE ...
36
37
  extern void proc_set_size(struct proc_dir_entry *, loff_t);
  extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
c30480b92   David Howells   proc: Make the PR...
38
  extern void *PDE_DATA(const struct inode *);
4a520d276   David Howells   proc: Supply an a...
39
  extern void *proc_get_parent_data(const struct inode *);
59d8053f1   David Howells   proc: Move non-pu...
40
41
42
43
44
  extern void proc_remove(struct proc_dir_entry *);
  extern void remove_proc_entry(const char *, struct proc_dir_entry *);
  extern int remove_proc_subtree(const char *, struct proc_dir_entry *);
  
  #else /* CONFIG_PROC_FS */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
45

647f010bf   Andrew Morton   init/main.c: remo...
46
47
48
  static inline void proc_root_init(void)
  {
  }
60347f671   Pavel Emelyanov   pid namespaces: p...
49
50
51
  static inline void proc_flush_task(struct task_struct *task)
  {
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
52

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
53
  static inline struct proc_dir_entry *proc_symlink(const char *name,
59d8053f1   David Howells   proc: Move non-pu...
54
  		struct proc_dir_entry *parent,const char *dest) { return NULL;}
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
55
56
  static inline struct proc_dir_entry *proc_mkdir(const char *name,
  	struct proc_dir_entry *parent) {return NULL;}
270b5ac21   David Howells   proc: Add proc_mk...
57
58
  static inline struct proc_dir_entry *proc_mkdir_data(const char *name,
  	umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; }
f12a20fc9   Randy Dunlap   procfs: add stub ...
59
  static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
d161a13f9   Al Viro   switch procfs to ...
60
  	umode_t mode, struct proc_dir_entry *parent) { return NULL; }
59d8053f1   David Howells   proc: Move non-pu...
61
62
  #define proc_create(name, mode, parent, proc_fops) ({NULL;})
  #define proc_create_data(name, mode, parent, proc_fops, data) ({NULL;})
271a15eab   David Howells   proc: Supply PDE ...
63
64
  static inline void proc_set_size(struct proc_dir_entry *de, loff_t size) {}
  static inline void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid) {}
c30480b92   David Howells   proc: Make the PR...
65
  static inline void *PDE_DATA(const struct inode *inode) {BUG(); return NULL;}
59d8053f1   David Howells   proc: Move non-pu...
66
  static inline void *proc_get_parent_data(const struct inode *inode) { BUG(); return NULL; }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
67

59d8053f1   David Howells   proc: Move non-pu...
68
69
70
  static inline void proc_remove(struct proc_dir_entry *de) {}
  #define remove_proc_entry(name, parent) do {} while (0)
  static inline int remove_proc_subtree(const char *name, struct proc_dir_entry *parent) { return 0; }
9043476f7   Al Viro   [PATCH] sanitize ...
71

59d8053f1   David Howells   proc: Move non-pu...
72
  #endif /* CONFIG_PROC_FS */
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
73

f77900296   Jeff Layton   lockd: move lockd...
74
  struct net;
270b5ac21   David Howells   proc: Add proc_mk...
75
76
77
78
79
  static inline struct proc_dir_entry *proc_net_mkdir(
  	struct net *net, const char *name, struct proc_dir_entry *parent)
  {
  	return proc_mkdir_data(name, 0, parent, net);
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
80
  #endif /* _LINUX_PROC_FS_H */