diff options
| author | Jon Maloy <[email protected]> | 2021-03-17 02:06:11 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2021-03-17 18:51:04 +0000 |
| commit | 50a3499ab853acd5ae5056231a576637af1bed8d (patch) | |
| tree | 2a85fa5c562ddad86125bcd17ef3278359b913d3 /net/tipc/node.c | |
| parent | tipc: introduce new unified address type for internal use (diff) | |
| download | kernel-50a3499ab853acd5ae5056231a576637af1bed8d.tar.gz kernel-50a3499ab853acd5ae5056231a576637af1bed8d.zip | |
tipc: simplify signature of tipc_namtbl_publish()
Using the new address structure tipc_uaddr, we simplify the signature
of function tipc_sk_publish() and tipc_namtbl_publish() so that fewer
parameters need to be passed around.
Signed-off-by: Jon Maloy <[email protected]>
Acked-by: Ying Xue <[email protected]>
Acked-by: Hoang Le <[email protected]>
Acked-by: Tung Nguyen <[email protected]>
Acked-by: Xin Long <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/tipc/node.c')
| -rw-r--r-- | net/tipc/node.c | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/net/tipc/node.c b/net/tipc/node.c index 9c95ef4b6326..e24cdc13335d 100644 --- a/net/tipc/node.c +++ b/net/tipc/node.c @@ -398,21 +398,23 @@ static void tipc_node_write_unlock_fast(struct tipc_node *n) static void tipc_node_write_unlock(struct tipc_node *n) __releases(n->lock) { + struct tipc_socket_addr sk; struct net *net = n->net; - u32 addr = 0; u32 flags = n->action_flags; - u32 link_id = 0; - u32 bearer_id; struct list_head *publ_list; + struct tipc_uaddr ua; + u32 bearer_id; if (likely(!flags)) { write_unlock_bh(&n->lock); return; } - addr = n->addr; - link_id = n->link_id; - bearer_id = link_id & 0xffff; + tipc_uaddr(&ua, TIPC_SERVICE_RANGE, TIPC_NODE_SCOPE, + TIPC_LINK_STATE, n->addr, n->addr); + sk.ref = n->link_id; + sk.node = n->addr; + bearer_id = n->link_id & 0xffff; publ_list = &n->publ_list; n->action_flags &= ~(TIPC_NOTIFY_NODE_DOWN | TIPC_NOTIFY_NODE_UP | @@ -421,20 +423,19 @@ static void tipc_node_write_unlock(struct tipc_node *n) write_unlock_bh(&n->lock); if (flags & TIPC_NOTIFY_NODE_DOWN) - tipc_publ_notify(net, publ_list, addr, n->capabilities); + tipc_publ_notify(net, publ_list, n->addr, n->capabilities); if (flags & TIPC_NOTIFY_NODE_UP) - tipc_named_node_up(net, addr, n->capabilities); + tipc_named_node_up(net, n->addr, n->capabilities); 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, link_id); + tipc_mon_peer_up(net, n->addr, bearer_id); + tipc_nametbl_publish(net, &ua, &sk, n->link_id); } if (flags & TIPC_NOTIFY_LINK_DOWN) { - tipc_mon_peer_down(net, addr, bearer_id); - tipc_nametbl_withdraw(net, TIPC_LINK_STATE, addr, - addr, link_id); + tipc_mon_peer_down(net, n->addr, bearer_id); + tipc_nametbl_withdraw(net, TIPC_LINK_STATE, n->addr, + n->addr, n->link_id); } } |
