6
6
#include <linux/spinlock.h>
7
7
#include <linux/magic.h>
8
8
#include <linux/atomic.h>
9
+ #include <linux/proc_ns.h>
9
10
10
11
struct net ;
11
12
struct completion ;
@@ -23,18 +24,6 @@ struct mm_struct;
23
24
/* Worst case buffer size needed for holding an integer. */
24
25
#define PROC_NUMBUF 13
25
26
26
- /*
27
- * We always define these enumerators
28
- */
29
-
30
- enum {
31
- PROC_ROOT_INO = 1 ,
32
- PROC_IPC_INIT_INO = 0xEFFFFFFFU ,
33
- PROC_UTS_INIT_INO = 0xEFFFFFFEU ,
34
- PROC_USER_INIT_INO = 0xEFFFFFFDU ,
35
- PROC_PID_INIT_INO = 0xEFFFFFFCU ,
36
- };
37
-
38
27
/*
39
28
* This is not completely implemented yet. The idea is to
40
29
* create an in-memory tree (like the actual /proc filesystem
@@ -81,10 +70,6 @@ struct proc_dir_entry *proc_create_data(const char *name, umode_t mode,
81
70
extern void remove_proc_entry (const char * name , struct proc_dir_entry * parent );
82
71
extern int remove_proc_subtree (const char * name , struct proc_dir_entry * parent );
83
72
84
- struct pid_namespace ;
85
-
86
- extern int pid_ns_prepare_proc (struct pid_namespace * ns );
87
- extern void pid_ns_release_proc (struct pid_namespace * ns );
88
73
89
74
/*
90
75
* proc_tty.c
@@ -132,12 +117,6 @@ extern struct proc_dir_entry *proc_net_mkdir(struct net *net, const char *name,
132
117
133
118
extern void proc_set_size (struct proc_dir_entry * , loff_t );
134
119
extern void proc_set_user (struct proc_dir_entry * , kuid_t , kgid_t );
135
-
136
- extern struct file * proc_ns_fget (int fd );
137
- extern bool proc_ns_inode (struct inode * inode );
138
-
139
- extern int proc_alloc_inum (unsigned int * pino );
140
- extern void proc_free_inum (unsigned int inum );
141
120
#else
142
121
143
122
static inline void proc_flush_task (struct task_struct * task )
@@ -168,50 +147,8 @@ struct tty_driver;
168
147
static inline void proc_tty_register_driver (struct tty_driver * driver ) {};
169
148
static inline void proc_tty_unregister_driver (struct tty_driver * driver ) {};
170
149
171
- static inline int pid_ns_prepare_proc (struct pid_namespace * ns )
172
- {
173
- return 0 ;
174
- }
175
-
176
- static inline void pid_ns_release_proc (struct pid_namespace * ns )
177
- {
178
- }
179
-
180
- static inline struct file * proc_ns_fget (int fd )
181
- {
182
- return ERR_PTR (- EINVAL );
183
- }
184
-
185
- static inline bool proc_ns_inode (struct inode * inode )
186
- {
187
- return false;
188
- }
189
-
190
- static inline int proc_alloc_inum (unsigned int * inum )
191
- {
192
- * inum = 1 ;
193
- return 0 ;
194
- }
195
- static inline void proc_free_inum (unsigned int inum )
196
- {
197
- }
198
150
#endif /* CONFIG_PROC_FS */
199
151
200
- struct nsproxy ;
201
- struct proc_ns_operations {
202
- const char * name ;
203
- int type ;
204
- void * (* get )(struct task_struct * task );
205
- void (* put )(void * ns );
206
- int (* install )(struct nsproxy * nsproxy , void * ns );
207
- unsigned int (* inum )(void * ns );
208
- };
209
- extern const struct proc_ns_operations netns_operations ;
210
- extern const struct proc_ns_operations utsns_operations ;
211
- extern const struct proc_ns_operations ipcns_operations ;
212
- extern const struct proc_ns_operations pidns_operations ;
213
- extern const struct proc_ns_operations userns_operations ;
214
- extern const struct proc_ns_operations mntns_operations ;
215
152
216
153
union proc_op {
217
154
int (* proc_get_link )(struct dentry * , struct path * );
@@ -231,8 +168,7 @@ struct proc_inode {
231
168
struct proc_dir_entry * pde ;
232
169
struct ctl_table_header * sysctl ;
233
170
struct ctl_table * sysctl_entry ;
234
- void * ns ;
235
- const struct proc_ns_operations * ns_ops ;
171
+ struct proc_ns ns ;
236
172
struct inode vfs_inode ;
237
173
};
238
174
0 commit comments