aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/proc_fs.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 21:10:16 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-25 21:10:16 -0400
commit14d74e0cab7a7779a7ff0c3863c04c8a8e507106 (patch)
tree5e27d7495f8f7ce178b637d588ec42bd7b4173d8 /include/linux/proc_fs.h
parent49a78d085fa6b44d6ed791923c7172a6433589c2 (diff)
parent956c920786694f51601a0ef7ee12956fd6aa216e (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd
* git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/linux-2.6-nsfd: net: fix get_net_ns_by_fd for !CONFIG_NET_NS ns proc: Return -ENOENT for a nonexistent /proc/self/ns/ entry. ns: Declare sys_setns in syscalls.h net: Allow setting the network namespace by fd ns proc: Add support for the ipc namespace ns proc: Add support for the uts namespace ns proc: Add support for the network namespace. ns: Introduce the setns syscall ns: proc files for namespace naming policy.
Diffstat (limited to 'include/linux/proc_fs.h')
-rw-r--r--include/linux/proc_fs.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 3686cd6c9aca..648c9c58add7 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -179,6 +179,8 @@ extern 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); 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); 180extern void dup_mm_exe_file(struct mm_struct *oldmm, struct mm_struct *newmm);
181 181
182extern struct file *proc_ns_fget(int fd);
183
182#else 184#else
183 185
184#define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; }) 186#define proc_net_fops_create(net, name, mode, fops) ({ (void)(mode), NULL; })
@@ -241,6 +243,11 @@ static inline void dup_mm_exe_file(struct mm_struct *oldmm,
241 struct mm_struct *newmm) 243 struct mm_struct *newmm)
242{} 244{}
243 245
246static inline struct file *proc_ns_fget(int fd)
247{
248 return ERR_PTR(-EINVAL);
249}
250
244#endif /* CONFIG_PROC_FS */ 251#endif /* CONFIG_PROC_FS */
245 252
246#if !defined(CONFIG_PROC_KCORE) 253#if !defined(CONFIG_PROC_KCORE)
@@ -252,6 +259,18 @@ kclist_add(struct kcore_list *new, void *addr, size_t size, int type)
252extern void kclist_add(struct kcore_list *, void *, size_t, int type); 259extern void kclist_add(struct kcore_list *, void *, size_t, int type);
253#endif 260#endif
254 261
262struct nsproxy;
263struct proc_ns_operations {
264 const char *name;
265 int type;
266 void *(*get)(struct task_struct *task);
267 void (*put)(void *ns);
268 int (*install)(struct nsproxy *nsproxy, void *ns);
269};
270extern const struct proc_ns_operations netns_operations;
271extern const struct proc_ns_operations utsns_operations;
272extern const struct proc_ns_operations ipcns_operations;
273
255union proc_op { 274union proc_op {
256 int (*proc_get_link)(struct inode *, struct path *); 275 int (*proc_get_link)(struct inode *, struct path *);
257 int (*proc_read)(struct task_struct *task, char *page); 276 int (*proc_read)(struct task_struct *task, char *page);
@@ -270,6 +289,8 @@ struct proc_inode {
270 struct proc_dir_entry *pde; 289 struct proc_dir_entry *pde;
271 struct ctl_table_header *sysctl; 290 struct ctl_table_header *sysctl;
272 struct ctl_table *sysctl_entry; 291 struct ctl_table *sysctl_entry;
292 void *ns;
293 const struct proc_ns_operations *ns_ops;
273 struct inode vfs_inode; 294 struct inode vfs_inode;
274}; 295};
275 296