Lines Matching defs:ns
22 struct ipc_namespace *ns;
25 ns = kmalloc(sizeof(struct ipc_namespace), GFP_KERNEL);
26 if (ns == NULL)
29 err = proc_alloc_inum(&ns->proc_inum);
31 kfree(ns);
35 atomic_set(&ns->count, 1);
36 err = mq_init_ns(ns);
38 proc_free_inum(ns->proc_inum);
39 kfree(ns);
44 sem_init_ns(ns);
45 msg_init_ns(ns);
46 shm_init_ns(ns);
49 * msgmni has already been computed for the new ipc ns.
54 register_ipcns_notifier(ns);
56 ns->user_ns = get_user_ns(user_ns);
58 return ns;
62 struct user_namespace *user_ns, struct ipc_namespace *ns)
65 return get_ipc_ns(ns);
66 return create_ipc_ns(user_ns, ns);
71 * @ns: the namespace to remove the ipcs from
77 void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids,
94 free(ns, perm);
100 static void free_ipc_ns(struct ipc_namespace *ns)
110 unregister_ipcns_notifier(ns);
111 sem_exit_ns(ns);
112 msg_exit_ns(ns);
113 shm_exit_ns(ns);
121 put_user_ns(ns->user_ns);
122 proc_free_inum(ns->proc_inum);
123 kfree(ns);
128 * @ns: the namespace to put
142 void put_ipc_ns(struct ipc_namespace *ns)
144 if (atomic_dec_and_lock(&ns->count, &mq_lock)) {
145 mq_clear_sbinfo(ns);
147 mq_put_mnt(ns);
148 free_ipc_ns(ns);
154 struct ipc_namespace *ns = NULL;
160 ns = get_ipc_ns(nsproxy->ipc_ns);
163 return ns;
166 static void ipcns_put(void *ns)
168 return put_ipc_ns(ns);
173 struct ipc_namespace *ns = new;
174 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) ||
181 nsproxy->ipc_ns = get_ipc_ns(ns);
187 struct ipc_namespace *ns = vp;
189 return ns->proc_inum;