diff options
author | Jon Paul Maloy <jon.maloy@ericsson.com> | 2015-10-22 08:51:46 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-24 09:56:45 -0400 |
commit | c72fa872a23f03b2b9c17e88f3b0a8070924e5f1 (patch) | |
tree | 852fd70aa5212a91390478247131ba9adb93b8fb /net/tipc/node.c | |
parent | 7214bcf8753109256d635ba079938fbd6fcf713b (diff) |
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.c | 7 |
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) | |||
178 | n_ptr->signature = INVALID_NODE_SIG; | 178 | n_ptr->signature = INVALID_NODE_SIG; |
179 | n_ptr->active_links[0] = INVALID_BEARER_ID; | 179 | n_ptr->active_links[0] = INVALID_BEARER_ID; |
180 | n_ptr->active_links[1] = INVALID_BEARER_ID; | 180 | n_ptr->active_links[1] = INVALID_BEARER_ID; |
181 | if (!tipc_link_bc_create(n_ptr, tipc_own_addr(net), n_ptr->addr, | 181 | if (!tipc_link_bc_create(net, tipc_own_addr(net), n_ptr->addr, |
182 | U16_MAX, tipc_bc_sndlink(net)->window, | 182 | U16_MAX, tipc_bc_sndlink(net)->window, |
183 | n_ptr->capabilities, | 183 | n_ptr->capabilities, |
184 | &n_ptr->bc_entry.inputq1, | 184 | &n_ptr->bc_entry.inputq1, |
@@ -366,7 +366,10 @@ static void __tipc_node_link_up(struct tipc_node *n, int bearer_id, | |||
366 | pr_debug("Old link <%s> becomes standby\n", ol->name); | 366 | pr_debug("Old link <%s> becomes standby\n", ol->name); |
367 | *slot0 = bearer_id; | 367 | *slot0 = bearer_id; |
368 | *slot1 = bearer_id; | 368 | *slot1 = bearer_id; |
369 | tipc_link_set_active(nl, true); | ||
370 | tipc_link_set_active(ol, false); | ||
369 | } else if (nl->priority == ol->priority) { | 371 | } else if (nl->priority == ol->priority) { |
372 | tipc_link_set_active(nl, true); | ||
370 | *slot0 = bearer_id; | 373 | *slot0 = bearer_id; |
371 | } else { | 374 | } else { |
372 | pr_debug("New link <%s> is standby\n", nl->name); | 375 | pr_debug("New link <%s> is standby\n", nl->name); |
@@ -599,7 +602,7 @@ void tipc_node_check_dest(struct net *net, u32 onode, | |||
599 | goto exit; | 602 | goto exit; |
600 | } | 603 | } |
601 | if_name = strchr(b->name, ':') + 1; | 604 | if_name = strchr(b->name, ':') + 1; |
602 | if (!tipc_link_create(n, if_name, b->identity, b->tolerance, | 605 | if (!tipc_link_create(net, if_name, b->identity, b->tolerance, |
603 | b->net_plane, b->mtu, b->priority, | 606 | b->net_plane, b->mtu, b->priority, |
604 | b->window, mod(tipc_net(net)->random), | 607 | b->window, mod(tipc_net(net)->random), |
605 | tipc_own_addr(net), onode, | 608 | tipc_own_addr(net), onode, |