Commit 98ed57ee authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Linus Torvalds

sysctl: make kernel.ns_last_pid control dependent on CHECKPOINT_RESTORE

For those who doesn't need C/R functionality there is no need to control
last pid, ie the pid for the next fork() call.
Signed-off-by: default avatarCyrill Gorcunov <gorcunov@openvz.org>
Cc: Pavel Emelyanov <xemul@parallels.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ac34ebb3
...@@ -196,6 +196,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns) ...@@ -196,6 +196,7 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
return; return;
} }
#ifdef CONFIG_CHECKPOINT_RESTORE
static int pid_ns_ctl_handler(struct ctl_table *table, int write, static int pid_ns_ctl_handler(struct ctl_table *table, int write,
void __user *buffer, size_t *lenp, loff_t *ppos) void __user *buffer, size_t *lenp, loff_t *ppos)
{ {
...@@ -223,8 +224,8 @@ static struct ctl_table pid_ns_ctl_table[] = { ...@@ -223,8 +224,8 @@ static struct ctl_table pid_ns_ctl_table[] = {
}, },
{ } { }
}; };
static struct ctl_path kern_path[] = { { .procname = "kernel", }, { } }; static struct ctl_path kern_path[] = { { .procname = "kernel", }, { } };
#endif /* CONFIG_CHECKPOINT_RESTORE */
int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd) int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd)
{ {
...@@ -258,7 +259,10 @@ int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd) ...@@ -258,7 +259,10 @@ int reboot_pid_ns(struct pid_namespace *pid_ns, int cmd)
static __init int pid_namespaces_init(void) static __init int pid_namespaces_init(void)
{ {
pid_ns_cachep = KMEM_CACHE(pid_namespace, SLAB_PANIC); pid_ns_cachep = KMEM_CACHE(pid_namespace, SLAB_PANIC);
#ifdef CONFIG_CHECKPOINT_RESTORE
register_sysctl_paths(kern_path, pid_ns_ctl_table); register_sysctl_paths(kern_path, pid_ns_ctl_table);
#endif
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment