15 #include <linux/acct.h>
16 #include <linux/slab.h>
18 #include <linux/reboot.h>
19 #include <linux/export.h>
21 #define BITS_PER_PAGE (PAGE_SIZE*8)
39 static struct kmem_cache *create_pid_cachep(
int nr_ids)
46 if (pcache->nr_ids == nr_ids)
60 pcache->nr_ids = nr_ids;
61 pcache->cachep = cachep;
62 list_add(&pcache->
list, &pid_caches_lh);
75 #define MAX_PID_NS_LEVEL 32
90 ns = kmem_cache_zalloc(pid_ns_cachep, GFP_KERNEL);
102 kref_init(&ns->
kref);
104 ns->
parent = get_pid_ns(parent_pid_ns);
114 goto out_put_parent_pid_ns;
118 out_put_parent_pid_ns:
140 return get_pid_ns(old_ns);
143 return create_pid_namespace(old_ns);
146 static void free_pid_ns(
struct kref *
kref)
151 destroy_pid_namespace(ns);
160 if (!kref_put(&ns->
kref, free_pid_ns))
174 spin_lock_irq(&me->
sighand->siglock);
176 spin_unlock_irq(&me->
sighand->siglock);
197 if (task && !__fatal_signal_pending(task))
217 bool need_wait =
false;
220 if (!list_empty(&
current->children)) {
238 #ifdef CONFIG_CHECKPOINT_RESTORE
240 void __user *
buffer,
size_t *lenp, loff_t *ppos)
259 static struct ctl_table pid_ns_ctl_table[] = {
262 .maxlen =
sizeof(
int),
302 static __init int pid_namespaces_init(
void)
306 #ifdef CONFIG_CHECKPOINT_RESTORE