netns: make nsid_lock per net
[firefly-linux-kernel-4.4.55.git] / include / net / net_namespace.h
index f733656404de0ea5cba33c83a641e37dc4e4d5e5..72eb2372329453e2f118a9af1627c7ad27e50721 100644 (file)
@@ -58,6 +58,7 @@ struct net {
        struct list_head        exit_list;      /* Use only net_mutex */
 
        struct user_namespace   *user_ns;       /* Owning user namespace */
+       spinlock_t              nsid_lock;
        struct idr              netns_ids;
 
        struct ns_common        ns;
@@ -271,7 +272,9 @@ static inline struct net *read_pnet(const possible_net_t *pnet)
 #define __net_initconst        __initconst
 #endif
 
+int peernet2id_alloc(struct net *net, struct net *peer);
 int peernet2id(struct net *net, struct net *peer);
+bool peernet_has_id(struct net *net, struct net *peer);
 struct net *get_net_ns_by_id(struct net *net, int id);
 
 struct pernet_operations {