aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/proc_ns.h
diff options
context:
space:
mode:
authorAditya Kali <adityakali@google.com>2016-01-29 03:54:06 -0500
committerTejun Heo <tj@kernel.org>2016-02-16 13:04:58 -0500
commita79a908fd2b080977b45bf103184b81c9d11ad07 (patch)
treefbfb2423937d1ff6ff72e5ca9fa852b0c8d7da98 /include/linux/proc_ns.h
parent5e2bec7c2248ae27c5b16cd97215ae05c1d39179 (diff)
cgroup: introduce cgroup namespaces
Introduce the ability to create new cgroup namespace. The newly created cgroup namespace remembers the cgroup of the process at the point of creation of the cgroup namespace (referred as cgroupns-root). The main purpose of cgroup namespace is to virtualize the contents of /proc/self/cgroup file. Processes inside a cgroup namespace are only able to see paths relative to their namespace root (unless they are moved outside of their cgroupns-root, at which point they will see a relative path from their cgroupns-root). For a correctly setup container this enables container-tools (like libcontainer, lxc, lmctfy, etc.) to create completely virtualized containers without leaking system level cgroup hierarchy to the task. This patch only implements the 'unshare' part of the cgroupns. Signed-off-by: Aditya Kali <adityakali@google.com> Signed-off-by: Serge Hallyn <serge.hallyn@canonical.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'include/linux/proc_ns.h')
-rw-r--r--include/linux/proc_ns.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/proc_ns.h b/include/linux/proc_ns.h
index 42dfc615dbf8..de0e7719d4c5 100644
--- a/include/linux/proc_ns.h
+++ b/include/linux/proc_ns.h
@@ -9,6 +9,8 @@
9struct pid_namespace; 9struct pid_namespace;
10struct nsproxy; 10struct nsproxy;
11struct path; 11struct path;
12struct task_struct;
13struct inode;
12 14
13struct proc_ns_operations { 15struct proc_ns_operations {
14 const char *name; 16 const char *name;
@@ -24,6 +26,7 @@ extern const struct proc_ns_operations ipcns_operations;
24extern const struct proc_ns_operations pidns_operations; 26extern const struct proc_ns_operations pidns_operations;
25extern const struct proc_ns_operations userns_operations; 27extern const struct proc_ns_operations userns_operations;
26extern const struct proc_ns_operations mntns_operations; 28extern const struct proc_ns_operations mntns_operations;
29extern const struct proc_ns_operations cgroupns_operations;
27 30
28/* 31/*
29 * We always define these enumerators 32 * We always define these enumerators
@@ -34,6 +37,7 @@ enum {
34 PROC_UTS_INIT_INO = 0xEFFFFFFEU, 37 PROC_UTS_INIT_INO = 0xEFFFFFFEU,
35 PROC_USER_INIT_INO = 0xEFFFFFFDU, 38 PROC_USER_INIT_INO = 0xEFFFFFFDU,
36 PROC_PID_INIT_INO = 0xEFFFFFFCU, 39 PROC_PID_INIT_INO = 0xEFFFFFFCU,
40 PROC_CGROUP_INIT_INO = 0xEFFFFFFBU,
37}; 41};
38 42
39#ifdef CONFIG_PROC_FS 43#ifdef CONFIG_PROC_FS