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 /net | |
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 'net')
-rw-r--r-- | net/core/net_namespace.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index 97f4dc2132ad..2161f0979fce 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -629,7 +629,7 @@ void unregister_pernet_device(struct pernet_operations *ops) | |||
629 | EXPORT_SYMBOL_GPL(unregister_pernet_device); | 629 | EXPORT_SYMBOL_GPL(unregister_pernet_device); |
630 | 630 | ||
631 | #ifdef CONFIG_NET_NS | 631 | #ifdef CONFIG_NET_NS |
632 | static void *netns_get(struct task_struct *task) | 632 | static struct ns_common *netns_get(struct task_struct *task) |
633 | { | 633 | { |
634 | struct net *net = NULL; | 634 | struct net *net = NULL; |
635 | struct nsproxy *nsproxy; | 635 | struct nsproxy *nsproxy; |
@@ -648,12 +648,12 @@ static inline struct net *to_net_ns(struct ns_common *ns) | |||
648 | return container_of(ns, struct net, ns); | 648 | return container_of(ns, struct net, ns); |
649 | } | 649 | } |
650 | 650 | ||
651 | static void netns_put(void *ns) | 651 | static void netns_put(struct ns_common *ns) |
652 | { | 652 | { |
653 | put_net(to_net_ns(ns)); | 653 | put_net(to_net_ns(ns)); |
654 | } | 654 | } |
655 | 655 | ||
656 | static int netns_install(struct nsproxy *nsproxy, void *ns) | 656 | static int netns_install(struct nsproxy *nsproxy, struct ns_common *ns) |
657 | { | 657 | { |
658 | struct net *net = to_net_ns(ns); | 658 | struct net *net = to_net_ns(ns); |
659 | 659 | ||
@@ -666,17 +666,11 @@ static int netns_install(struct nsproxy *nsproxy, void *ns) | |||
666 | return 0; | 666 | return 0; |
667 | } | 667 | } |
668 | 668 | ||
669 | static unsigned int netns_inum(void *ns) | ||
670 | { | ||
671 | return ((struct ns_common *)ns)->inum; | ||
672 | } | ||
673 | |||
674 | const struct proc_ns_operations netns_operations = { | 669 | const struct proc_ns_operations netns_operations = { |
675 | .name = "net", | 670 | .name = "net", |
676 | .type = CLONE_NEWNET, | 671 | .type = CLONE_NEWNET, |
677 | .get = netns_get, | 672 | .get = netns_get, |
678 | .put = netns_put, | 673 | .put = netns_put, |
679 | .install = netns_install, | 674 | .install = netns_install, |
680 | .inum = netns_inum, | ||
681 | }; | 675 | }; |
682 | #endif | 676 | #endif |