Lines Matching defs:nsproxy

14 #include <linux/nsproxy.h>
32 struct nsproxy init_nsproxy = {
52 static inline struct nsproxy *create_nsproxy(void)
54 struct nsproxy *nsproxy;
56 nsproxy = kmem_cache_alloc(nsproxy_cachep, GFP_KERNEL);
57 if (nsproxy)
58 refcount_set(&nsproxy->count, 1);
59 return nsproxy;
63 * Create new nsproxy and all of its the associated namespaces.
64 * Return the newly created nsproxy. Do not attach this to the task,
67 static struct nsproxy *create_new_namespaces(unsigned long flags,
71 struct nsproxy *new_nsp;
78 new_nsp->mnt_ns = copy_mnt_ns(flags, tsk->nsproxy->mnt_ns, user_ns, new_fs);
84 new_nsp->uts_ns = copy_utsname(flags, user_ns, tsk->nsproxy->uts_ns);
90 new_nsp->ipc_ns = copy_ipcs(flags, user_ns, tsk->nsproxy->ipc_ns);
97 copy_pid_ns(flags, user_ns, tsk->nsproxy->pid_ns_for_children);
104 tsk->nsproxy->cgroup_ns);
110 new_nsp->net_ns = copy_net_ns(flags, user_ns, tsk->nsproxy->net_ns);
117 tsk->nsproxy->time_ns_for_children);
122 new_nsp->time_ns = get_time_ns(tsk->nsproxy->time_ns);
148 * called from clone. This now handles copy for nsproxy and all
153 struct nsproxy *old_ns = tsk->nsproxy;
155 struct nsproxy *new_ns;
186 tsk->nsproxy = new_ns;
190 void free_nsproxy(struct nsproxy *ns)
210 * Called from unshare. Unshare all the namespaces part of nsproxy.
211 * On success, returns the new nsproxy.
214 struct nsproxy **new_nsp, struct cred *new_cred, struct fs_struct *new_fs)
239 void switch_task_namespaces(struct task_struct *p, struct nsproxy *new)
241 struct nsproxy *ns;
246 ns = p->nsproxy;
247 p->nsproxy = new;
262 struct nsproxy *new;
264 if (tsk->nsproxy->time_ns_for_children == tsk->nsproxy->time_ns)
327 if (nsset->nsproxy)
328 free_nsproxy(nsset->nsproxy);
335 nsset->nsproxy = create_new_namespaces(0, me, current_user_ns(), me->fs);
336 if (IS_ERR(nsset->nsproxy))
337 return PTR_ERR(nsset->nsproxy);
381 struct nsproxy *nsp;
398 nsp = tsk->nsproxy;
538 timens_commit(me, nsset->nsproxy->time_ns);
542 switch_task_namespaces(me, nsset->nsproxy);
543 nsset->nsproxy = NULL;
589 nsproxy_cachep = KMEM_CACHE(nsproxy, SLAB_PANIC|SLAB_ACCOUNT);