summaryrefslogtreecommitdiffstats
path: root/ipc/namespace.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-11-01 00:37:32 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-12-04 14:34:17 -0500
commit64964528b24ea390824f0e5ce9d34b8d39b28cde (patch)
tree2de66d75468ad4ddecc7e175f86f1dbaae47ea9a /ipc/namespace.c
parent3c0411846118a578de3a979faf2da3ab5fb81179 (diff)
make proc_ns_operations work with struct ns_common * instead of void *
We can do that now. And kill ->inum(), while we are at it - all instances are identical. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'ipc/namespace.c')
-rw-r--r--ipc/namespace.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/ipc/namespace.c b/ipc/namespace.c
index 3c1e8d3bd7d3..531029a67fef 100644
--- a/ipc/namespace.c
+++ b/ipc/namespace.c
@@ -154,7 +154,7 @@ static inline struct ipc_namespace *to_ipc_ns(struct ns_common *ns)
154 return container_of(ns, struct ipc_namespace, ns); 154 return container_of(ns, struct ipc_namespace, ns);
155} 155}
156 156
157static void *ipcns_get(struct task_struct *task) 157static struct ns_common *ipcns_get(struct task_struct *task)
158{ 158{
159 struct ipc_namespace *ns = NULL; 159 struct ipc_namespace *ns = NULL;
160 struct nsproxy *nsproxy; 160 struct nsproxy *nsproxy;
@@ -168,12 +168,12 @@ static void *ipcns_get(struct task_struct *task)
168 return ns ? &ns->ns : NULL; 168 return ns ? &ns->ns : NULL;
169} 169}
170 170
171static void ipcns_put(void *ns) 171static void ipcns_put(struct ns_common *ns)
172{ 172{
173 return put_ipc_ns(to_ipc_ns(ns)); 173 return put_ipc_ns(to_ipc_ns(ns));
174} 174}
175 175
176static int ipcns_install(struct nsproxy *nsproxy, void *new) 176static int ipcns_install(struct nsproxy *nsproxy, struct ns_common *new)
177{ 177{
178 struct ipc_namespace *ns = to_ipc_ns(new); 178 struct ipc_namespace *ns = to_ipc_ns(new);
179 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) || 179 if (!ns_capable(ns->user_ns, CAP_SYS_ADMIN) ||
@@ -187,16 +187,10 @@ static int ipcns_install(struct nsproxy *nsproxy, void *new)
187 return 0; 187 return 0;
188} 188}
189 189
190static unsigned int ipcns_inum(void *vp)
191{
192 return ((struct ns_common *)vp)->inum;
193}
194
195const struct proc_ns_operations ipcns_operations = { 190const struct proc_ns_operations ipcns_operations = {
196 .name = "ipc", 191 .name = "ipc",
197 .type = CLONE_NEWIPC, 192 .type = CLONE_NEWIPC,
198 .get = ipcns_get, 193 .get = ipcns_get,
199 .put = ipcns_put, 194 .put = ipcns_put,
200 .install = ipcns_install, 195 .install = ipcns_install,
201 .inum = ipcns_inum,
202}; 196};