net: restore net_create and make it globally visible
Subsystems (2)
RFC v3 3/5 net: restore net_create and make it globally visible
This reverts commit 911cb193f3eb0370f20fbba712211e55ffede4de and makes net_create() globally visible. net_create() will be needed for fake_net in fs/proc/proc_net.c.
Signed-off-by Vasiliy Kulikov <[email protected]>
--- include/net/net_namespace.h | 2 ++ net/core/net_namespace.c | 12 ++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-)
include/net/net_namespace.h +2 -0
@@ -116,6 +116,8 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) }#endif /* CONFIG_NET */ +extern struct net *net_create (void ); +extern struct list_head net_namespace_list;
net/core/net_namespace.c +8 -4
@@ -210,14 +210,11 @@ static void net_free(struct net *net)kmem_cache_free (net_cachep, net); } -struct net *copy_net_ns (unsigned long flags,struct net *old_net) +struct net *net_create (void ) {struct net *net;int rv; -if (!(flags &CLONE_NEWNET )) -return get_net (old_net); - net =net_alloc ();if (!net)return ERR_PTR (-ENOMEM );
@@ -236,6 +233,13 @@ struct net *copy_net_ns(unsigned long flags, struct net *old_net)return net; } +struct net *copy_net_ns (unsigned long flags,struct net *old_net) +{ +if (!(flags &CLONE_NEWNET )) +return get_net (old_net); +return net_create (); +} +static DEFINE_SPINLOCK (cleanup_list_lock);static LIST_HEAD (cleanup_list);/* Must hold cleanup_list_lock to touch */
Signature · 1 line
1.7.0.4