aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/user_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 /kernel/user_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 'kernel/user_namespace.c')
-rw-r--r--kernel/user_namespace.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c
index 1ab2209228ff..29cd5ccfc37a 100644
--- a/kernel/user_namespace.c
+++ b/kernel/user_namespace.c
@@ -846,7 +846,7 @@ static inline struct user_namespace *to_user_ns(struct ns_common *ns)
846 return container_of(ns, struct user_namespace, ns); 846 return container_of(ns, struct user_namespace, ns);
847} 847}
848 848
849static void *userns_get(struct task_struct *task) 849static struct ns_common *userns_get(struct task_struct *task)
850{ 850{
851 struct user_namespace *user_ns; 851 struct user_namespace *user_ns;
852 852
@@ -857,12 +857,12 @@ static void *userns_get(struct task_struct *task)
857 return user_ns ? &user_ns->ns : NULL; 857 return user_ns ? &user_ns->ns : NULL;
858} 858}
859 859
860static void userns_put(void *ns) 860static void userns_put(struct ns_common *ns)
861{ 861{
862 put_user_ns(to_user_ns(ns)); 862 put_user_ns(to_user_ns(ns));
863} 863}
864 864
865static int userns_install(struct nsproxy *nsproxy, void *ns) 865static int userns_install(struct nsproxy *nsproxy, struct ns_common *ns)
866{ 866{
867 struct user_namespace *user_ns = to_user_ns(ns); 867 struct user_namespace *user_ns = to_user_ns(ns);
868 struct cred *cred; 868 struct cred *cred;
@@ -893,18 +893,12 @@ static int userns_install(struct nsproxy *nsproxy, void *ns)
893 return commit_creds(cred); 893 return commit_creds(cred);
894} 894}
895 895
896static unsigned int userns_inum(void *ns)
897{
898 return ((struct ns_common *)ns)->inum;
899}
900
901const struct proc_ns_operations userns_operations = { 896const struct proc_ns_operations userns_operations = {
902 .name = "user", 897 .name = "user",
903 .type = CLONE_NEWUSER, 898 .type = CLONE_NEWUSER,
904 .get = userns_get, 899 .get = userns_get,
905 .put = userns_put, 900 .put = userns_put,
906 .install = userns_install, 901 .install = userns_install,
907 .inum = userns_inum,
908}; 902};
909 903
910static __init int user_namespaces_init(void) 904static __init int user_namespaces_init(void)