netns: rename peernet2id() to peernet2id_alloc()
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 7 May 2015 09:02:49 +0000 (11:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 10 May 2015 02:15:30 +0000 (22:15 -0400)
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>
drivers/net/vxlan.c
include/net/net_namespace.h
net/core/net_namespace.c
net/core/rtnetlink.c

index 3517ab0aa803a24b6f8ff48c45fc51cfa032adf1..48341ae490129221d491b516da9f801e9bf8a2e8 100644 (file)
@@ -336,7 +336,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 37c68bb72db3c27e6433c769c65d041be2bb7c5c..9c806ac569f9dd80b1cac0c0738408ba6413157e 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 666e0928ba404b85cf210749e505a2c205e5ee3f..83e08323fdcd4167354ce28bbfc7195205f1fa0e 100644 (file)
@@ -1204,7 +1204,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;
This page took 0.028296 seconds and 5 git commands to generate.