diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2014-11-01 00:37:32 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-12-04 14:34:17 -0500 |
commit | 64964528b24ea390824f0e5ce9d34b8d39b28cde (patch) | |
tree | 2de66d75468ad4ddecc7e175f86f1dbaae47ea9a /kernel/pid_namespace.c | |
parent | 3c0411846118a578de3a979faf2da3ab5fb81179 (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 'kernel/pid_namespace.c')
-rw-r--r-- | kernel/pid_namespace.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/kernel/pid_namespace.c b/kernel/pid_namespace.c index dd961ad86fbd..79aabce49a85 100644 --- a/kernel/pid_namespace.c +++ b/kernel/pid_namespace.c | |||
@@ -318,7 +318,7 @@ static inline struct pid_namespace *to_pid_ns(struct ns_common *ns) | |||
318 | return container_of(ns, struct pid_namespace, ns); | 318 | return container_of(ns, struct pid_namespace, ns); |
319 | } | 319 | } |
320 | 320 | ||
321 | static void *pidns_get(struct task_struct *task) | 321 | static struct ns_common *pidns_get(struct task_struct *task) |
322 | { | 322 | { |
323 | struct pid_namespace *ns; | 323 | struct pid_namespace *ns; |
324 | 324 | ||
@@ -331,12 +331,12 @@ static void *pidns_get(struct task_struct *task) | |||
331 | return ns ? &ns->ns : NULL; | 331 | return ns ? &ns->ns : NULL; |
332 | } | 332 | } |
333 | 333 | ||
334 | static void pidns_put(void *ns) | 334 | static void pidns_put(struct ns_common *ns) |
335 | { | 335 | { |
336 | put_pid_ns(to_pid_ns(ns)); | 336 | put_pid_ns(to_pid_ns(ns)); |
337 | } | 337 | } |
338 | 338 | ||
339 | static int pidns_install(struct nsproxy *nsproxy, void *ns) | 339 | static int pidns_install(struct nsproxy *nsproxy, struct ns_common *ns) |
340 | { | 340 | { |
341 | struct pid_namespace *active = task_active_pid_ns(current); | 341 | struct pid_namespace *active = task_active_pid_ns(current); |
342 | struct pid_namespace *ancestor, *new = to_pid_ns(ns); | 342 | struct pid_namespace *ancestor, *new = to_pid_ns(ns); |
@@ -367,18 +367,12 @@ static int pidns_install(struct nsproxy *nsproxy, void *ns) | |||
367 | return 0; | 367 | return 0; |
368 | } | 368 | } |
369 | 369 | ||
370 | static unsigned int pidns_inum(void *ns) | ||
371 | { | ||
372 | return ((struct ns_common *)ns)->inum; | ||
373 | } | ||
374 | |||
375 | const struct proc_ns_operations pidns_operations = { | 370 | const struct proc_ns_operations pidns_operations = { |
376 | .name = "pid", | 371 | .name = "pid", |
377 | .type = CLONE_NEWPID, | 372 | .type = CLONE_NEWPID, |
378 | .get = pidns_get, | 373 | .get = pidns_get, |
379 | .put = pidns_put, | 374 | .put = pidns_put, |
380 | .install = pidns_install, | 375 | .install = pidns_install, |
381 | .inum = pidns_inum, | ||
382 | }; | 376 | }; |
383 | 377 | ||
384 | static __init int pid_namespaces_init(void) | 378 | static __init int pid_namespaces_init(void) |