summaryrefslogtreecommitdiff
path: root/net/tipc/core.h
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2015-01-09 10:27:05 +0300
committerDavid S. Miller <davem@davemloft.net>2015-01-13 00:24:32 +0300
commitf2f9800d4955a96d92896841d8ba9b04201deaa1 (patch)
tree3b817800cfd8fcb2de6d5a3d7eb4fff972fba681 /net/tipc/core.h
parentc93d3baa24095887005647984cff5de8c63d3611 (diff)
downloadlinux-f2f9800d4955a96d92896841d8ba9b04201deaa1.tar.xz
tipc: make tipc node table aware of net namespace
Global variables associated with node table are below: - node table list (node_htable) - node hash table list (tipc_node_list) - node table lock (node_list_lock) - node number counter (tipc_num_nodes) - node link number counter (tipc_num_links) To make node table support namespace, above global variables must be moved to tipc_net structure in order to keep secret for different namespaces. As a consequence, these variables are allocated and initialized when namespace is created, and deallocated when namespace is destroyed. After the change, functions associated with these variables have to utilize a namespace pointer to access them. So adding namespace pointer as a parameter of these functions is the major change made in the commit. Signed-off-by: Ying Xue <ying.xue@windriver.com> Tested-by: Tero Aho <Tero.Aho@coriant.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/core.h')
-rw-r--r--net/tipc/core.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/tipc/core.h b/net/tipc/core.h
index 106e8150c3a6..4fb113397e7b 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -59,6 +59,8 @@
#include <linux/etherdevice.h>
#include <net/netns/generic.h>
+#include "node.h"
+
#define TIPC_MOD_VER "2.0.0"
int tipc_snprintf(char *buf, int len, const char *fmt, ...);
@@ -78,6 +80,13 @@ extern int tipc_random __read_mostly;
struct tipc_net {
int net_id;
+
+ /* Node table and node list */
+ spinlock_t node_list_lock;
+ struct hlist_head node_htable[NODE_HTABLE_SIZE];
+ struct list_head node_list;
+ u32 num_nodes;
+ u32 num_links;
};
#ifdef CONFIG_SYSCTL