diff --git a/net/tipc/node.c b/net/tipc/node.c index 153425997cced306df3a7a77699b7fa97c87a4fb..1790f503f57b693388983c96087af45e69fc7d55 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -39,6 +39,8 @@ #include "node.h" #include "name_distr.h" +#define NODE_HTABLE_SIZE 512 + static void node_lost_contact(struct tipc_node *n_ptr); static void node_established_contact(struct tipc_node *n_ptr); @@ -50,6 +52,17 @@ static u32 tipc_num_nodes; static atomic_t tipc_num_links = ATOMIC_INIT(0); +/* + * A trivial power-of-two bitmask technique is used for speed, since this + * operation is done for every incoming TIPC packet. The number of hash table + * entries has been chosen so that no hash chain exceeds 8 nodes and will + * usually be much smaller (typically only a single node). + */ +static inline unsigned int tipc_hashfn(u32 addr) +{ + return addr & (NODE_HTABLE_SIZE - 1); +} + /* * tipc_node_find - locate specified node object, if it exists */ diff --git a/net/tipc/node.h b/net/tipc/node.h index 7bf526af1dfb6914e4ecccb8454e673d2208d5cf..72561c971d6735f622fe65428b013e6e0d683f20 100644 --- a/net/tipc/node.h +++ b/net/tipc/node.h @@ -107,20 +107,8 @@ struct tipc_node { } bclink; }; -#define NODE_HTABLE_SIZE 512 extern struct list_head tipc_node_list; -/* - * A trivial power-of-two bitmask technique is used for speed, since this - * operation is done for every incoming TIPC packet. The number of hash table - * entries has been chosen so that no hash chain exceeds 8 nodes and will - * usually be much smaller (typically only a single node). - */ -static inline unsigned int tipc_hashfn(u32 addr) -{ - return addr & (NODE_HTABLE_SIZE - 1); -} - struct tipc_node *tipc_node_find(u32 addr); struct tipc_node *tipc_node_create(u32 addr); void tipc_node_delete(struct tipc_node *n_ptr);