summaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2018-03-29 23:20:41 +0200
committerDavid S. Miller <davem@davemloft.net>2018-04-01 04:19:52 +0200
commit218527fe27adaebeb81eb770459eb335517e90ee (patch)
tree42001e81e0214aedd8d42ebf810f4d7542ce6a8a /net/tipc/node.c
parentMerge branch 'bridge-mtu' (diff)
downloadlinux-218527fe27adaebeb81eb770459eb335517e90ee.tar.xz
linux-218527fe27adaebeb81eb770459eb335517e90ee.zip
tipc: replace name table service range array with rb tree
The current design of the binding table has an unnecessary memory consuming and complex data structure. It aggregates the service range items into an array, which is expanded by a factor two every time it becomes too small to hold a new item. Furthermore, the arrays never shrink when the number of ranges diminishes. We now replace this array with an RB tree that is holding the range items as tree nodes, each range directly holding a list of bindings. This, along with a few name changes, improves both readability and volume of the code, as well as reducing memory consumption and hopefully improving cache hit rate. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index 4fb4327311bb..85e777e00ec9 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -324,12 +324,12 @@ static void tipc_node_write_unlock(struct tipc_node *n)
if (flags & TIPC_NOTIFY_LINK_UP) {
tipc_mon_peer_up(net, addr, bearer_id);
tipc_nametbl_publish(net, TIPC_LINK_STATE, addr, addr,
- TIPC_NODE_SCOPE, link_id, addr);
+ TIPC_NODE_SCOPE, link_id, link_id);
}
if (flags & TIPC_NOTIFY_LINK_DOWN) {
tipc_mon_peer_down(net, addr, bearer_id);
tipc_nametbl_withdraw(net, TIPC_LINK_STATE, addr,
- link_id, addr);
+ link_id, link_id);
}
}