]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
netns: rename peernet2id() to peernet2id_alloc()
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 7 May 2015 09:02:49 +0000 (11:02 +0200)
committerDhaval Giani <dhaval.giani@oracle.com>
Tue, 7 Nov 2017 05:24:14 +0000 (00:24 -0500)
In a following commit, a new function will be introduced to only lookup for
a nsid (no allocation if the nsid doesn't exist). To avoid confusion, the
existing function is renamed.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Orabug: 23634951
(cherry picked from commit 7a0877d4b438886b72be61632eaa774d13262f70)
Signed-off-by: Cathy Zhou <Cathy.Zhou@Oracle.COM>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
drivers/net/vxlan.c
include/net/net_namespace.h
net/core/net_namespace.c
net/core/rtnetlink.c

index dcc79652d7750d50e11c856f02d7dddb9cffb0aa..031bb8233afcb1e9eccbf18d0030108cfc4711be 100644 (file)
@@ -337,7 +337,7 @@ static int vxlan_fdb_info(struct sk_buff *skb, struct vxlan_dev *vxlan,
 
        if (!net_eq(dev_net(vxlan->dev), vxlan->net) &&
            nla_put_s32(skb, NDA_LINK_NETNSID,
-                       peernet2id(dev_net(vxlan->dev), vxlan->net)))
+                       peernet2id_alloc(dev_net(vxlan->dev), vxlan->net)))
                goto nla_put_failure;
 
        if (send_eth && nla_put(skb, NDA_LLADDR, ETH_ALEN, &fdb->eth_addr))
index f733656404de0ea5cba33c83a641e37dc4e4d5e5..6d1e2eae32fbbc4f5ea2fff3a7128e8291011f19 100644 (file)
@@ -271,7 +271,7 @@ static inline struct net *read_pnet(const possible_net_t *pnet)
 #define __net_initconst        __initconst
 #endif
 
-int peernet2id(struct net *net, struct net *peer);
+int peernet2id_alloc(struct net *net, struct net *peer);
 struct net *get_net_ns_by_id(struct net *net, int id);
 
 struct pernet_operations {
index a1845507efd02779c5ce0fb3f0382ae9fe222957..ee10027015846fee024fd25596fc70714f285fe2 100644 (file)
@@ -202,13 +202,13 @@ static int __peernet2id(struct net *net, struct net *peer, bool alloc)
 /* This function returns the id of a peer netns. If no id is assigned, one will
  * be allocated and returned.
  */
-int peernet2id(struct net *net, struct net *peer)
+int peernet2id_alloc(struct net *net, struct net *peer)
 {
        bool alloc = atomic_read(&peer->count) == 0 ? false : true;
 
        return __peernet2id(net, peer, alloc);
 }
-EXPORT_SYMBOL(peernet2id);
+EXPORT_SYMBOL(peernet2id_alloc);
 
 struct net *get_net_ns_by_id(struct net *net, int id)
 {
index ad4a69d0f230da20a2dd60a9428b78534ccbd67c..648d73d031deb26b28b43d6f9b52e7cedccbdc3b 100644 (file)
@@ -1206,7 +1206,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
                struct net *link_net = dev->rtnl_link_ops->get_link_net(dev);
 
                if (!net_eq(dev_net(dev), link_net)) {
-                       int id = peernet2id(dev_net(dev), link_net);
+                       int id = peernet2id_alloc(dev_net(dev), link_net);
 
                        if (nla_put_s32(skb, IFLA_LINK_NETNSID, id))
                                goto nla_put_failure;