struct ipc_namespace *copy_ipcs(unsigned long flags, struct user_namespace *user_ns, struct ipc_namespace *ns) { if (!(flags & CLONE_NEWIPC)) return get_ipc_ns(ns); return create_ipc_ns(user_ns, ns); }
static int ipcns_install(struct nsproxy *nsproxy, void *ns) { /* Ditch state from the old ipc namespace */ exit_sem(current); put_ipc_ns(nsproxy->ipc_ns); nsproxy->ipc_ns = get_ipc_ns(ns); return 0; }
struct ipc_namespace *copy_ipcs(unsigned long flags, struct task_struct *tsk) { struct ipc_namespace *ns = tsk->nsproxy->ipc_ns; if (!(flags & CLONE_NEWIPC)) return get_ipc_ns(ns); return create_ipc_ns(tsk, ns); }
static void *ipcns_get(struct task_struct *task) { struct ipc_namespace *ns = NULL; struct nsproxy *nsproxy; rcu_read_lock(); nsproxy = task_nsproxy(task); if (nsproxy) ns = get_ipc_ns(nsproxy->ipc_ns); rcu_read_unlock(); return ns; }
static struct ns_common *ipcns_get(struct task_struct *task) { struct ipc_namespace *ns = NULL; struct nsproxy *nsproxy; task_lock(task); nsproxy = task->nsproxy; if (nsproxy) ns = get_ipc_ns(nsproxy->ipc_ns); task_unlock(task); return ns ? &ns->ns : NULL; }
struct ipc_namespace *copy_ipcs(unsigned long flags, struct ipc_namespace *ns) { struct ipc_namespace *new_ns; BUG_ON(!ns); get_ipc_ns(ns); if (!(flags & CLONE_NEWIPC)) return ns; new_ns = clone_ipc_ns(ns); put_ipc_ns(ns); return new_ns; }