aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/node.c
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-10-22 08:51:46 -0400
committerDavid S. Miller <davem@davemloft.net>2015-10-24 06:56:45 -0700
commitc72fa872a23f03b2b9c17e88f3b0a8070924e5f1 (patch)
tree852fd70aa5212a91390478247131ba9adb93b8fb /net/tipc/node.c
parenttipc: eliminate redundant buffer cloning at transmission (diff)
downloadlinux-dev-c72fa872a23f03b2b9c17e88f3b0a8070924e5f1.tar.xz
linux-dev-c72fa872a23f03b2b9c17e88f3b0a8070924e5f1.zip
tipc: eliminate link's reference to owner node
With the recent commit series, we have established a one-way dependency between the link aggregation (struct tipc_node) instances and their pertaining tipc_link instances. This has enabled quite significant code and structure simplifications. In this commit, we eliminate the field 'owner', which points to an instance of struct tipc_node, from struct tipc_link, and replace it with a pointer to struct net, which is the only external reference now needed by a link instance. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/node.c')
-rw-r--r--net/tipc/node.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c
index b27439097d6c..eb739d20ed46 100644
--- a/net/tipc/node.c
+++ b/net/tipc/node.c
@@ -178,7 +178,7 @@ struct tipc_node *tipc_node_create(struct net *net, u32 addr, u16 capabilities)
n_ptr->signature = INVALID_NODE_SIG;
n_ptr->active_links[0] = INVALID_BEARER_ID;
n_ptr->active_links[1] = INVALID_BEARER_ID;
- if (!tipc_link_bc_create(n_ptr, tipc_own_addr(net), n_ptr->addr,
+ if (!tipc_link_bc_create(net, tipc_own_addr(net), n_ptr->addr,
U16_MAX, tipc_bc_sndlink(net)->window,
n_ptr->capabilities,
&n_ptr->bc_entry.inputq1,
@@ -366,7 +366,10 @@ static void __tipc_node_link_up(struct tipc_node *n, int bearer_id,
pr_debug("Old link <%s> becomes standby\n", ol->name);
*slot0 = bearer_id;
*slot1 = bearer_id;
+ tipc_link_set_active(nl, true);
+ tipc_link_set_active(ol, false);
} else if (nl->priority == ol->priority) {
+ tipc_link_set_active(nl, true);
*slot0 = bearer_id;
} else {
pr_debug("New link <%s> is standby\n", nl->name);
@@ -599,7 +602,7 @@ void tipc_node_check_dest(struct net *net, u32 onode,
goto exit;
}
if_name = strchr(b->name, ':') + 1;
- if (!tipc_link_create(n, if_name, b->identity, b->tolerance,
+ if (!tipc_link_create(net, if_name, b->identity, b->tolerance,
b->net_plane, b->mtu, b->priority,
b->window, mod(tipc_net(net)->random),
tipc_own_addr(net), onode,