aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
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
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')
-rw-r--r--include/linux/if_link.h1
-rw-r--r--include/linux/proc_fs.h21
-rw-r--r--include/linux/syscalls.h1
3 files changed, 23 insertions, 0 deletions
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index f4a2e6b1b864..0ee969a5593d 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -136,6 +136,7 @@ enum {
136 IFLA_PORT_SELF, 136 IFLA_PORT_SELF,
137 IFLA_AF_SPEC, 137 IFLA_AF_SPEC,
138 IFLA_GROUP, /* Group the device belongs to */ 138 IFLA_GROUP, /* Group the device belongs to */
139 IFLA_NET_NS_FD,
139 __IFLA_MAX 140 __IFLA_MAX
140}; 141};
141 142
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
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index ab71447d0c5a..8c03b98df5f9 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -846,4 +846,5 @@ asmlinkage long sys_name_to_handle_at(int dfd, const char __user *name,
846asmlinkage long sys_open_by_handle_at(int mountdirfd, 846asmlinkage long sys_open_by_handle_at(int mountdirfd,
847 struct file_handle __user *handle, 847 struct file_handle __user *handle,
848 int flags); 848 int flags);
849asmlinkage long sys_setns(int fd, int nstype);
849#endif 850#endif