mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-10 00:26:34 +00:00
tipc: obsolete TIPC_ZONE_SCOPE
Publications for TIPC_CLUSTER_SCOPE and TIPC_ZONE_SCOPE are in all aspects handled the same way, both on the publishing node and on the receiving nodes. Despite previous ambitions to the contrary, this is never going to change, so we take the conseqeunce of this and obsolete TIPC_ZONE_SCOPE and related macros/functions. Whenever a user is doing a bind() or a sendmsg() attempt using ZONE_SCOPE we translate this internally to CLUSTER_SCOPE, while we remain compatible with users and remote nodes still using ZONE_SCOPE. Furthermore, the non-formalized scope value 0 has always been permitted for use during lookup, with the same meaning as ZONE_SCOPE/CLUSTER_SCOPE. We now permit it even as binding scope, but for compatibility reasons we choose to not change the value of TIPC_CLUSTER_SCOPE. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4f1aec01fc
commit
928df1880e
7 changed files with 77 additions and 88 deletions
|
@ -63,23 +63,6 @@ int in_own_node(struct net *net, u32 addr)
|
|||
return (addr == tn->own_addr) || !addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* addr_domain - convert 2-bit scope value to equivalent message lookup domain
|
||||
*
|
||||
* Needed when address of a named message must be looked up a second time
|
||||
* after a network hop.
|
||||
*/
|
||||
u32 addr_domain(struct net *net, u32 sc)
|
||||
{
|
||||
struct tipc_net *tn = net_generic(net, tipc_net_id);
|
||||
|
||||
if (likely(sc == TIPC_NODE_SCOPE))
|
||||
return tn->own_addr;
|
||||
if (sc == TIPC_CLUSTER_SCOPE)
|
||||
return tipc_cluster_mask(tn->own_addr);
|
||||
return tipc_zone_mask(tn->own_addr);
|
||||
}
|
||||
|
||||
/**
|
||||
* tipc_addr_domain_valid - validates a network domain address
|
||||
*
|
||||
|
@ -124,20 +107,6 @@ int tipc_in_scope(u32 domain, u32 addr)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* tipc_addr_scope - convert message lookup domain to a 2-bit scope value
|
||||
*/
|
||||
int tipc_addr_scope(u32 domain)
|
||||
{
|
||||
if (likely(!domain))
|
||||
return TIPC_ZONE_SCOPE;
|
||||
if (tipc_node(domain))
|
||||
return TIPC_NODE_SCOPE;
|
||||
if (tipc_cluster(domain))
|
||||
return TIPC_CLUSTER_SCOPE;
|
||||
return TIPC_ZONE_SCOPE;
|
||||
}
|
||||
|
||||
char *tipc_addr_string_fill(char *string, u32 addr)
|
||||
{
|
||||
snprintf(string, 16, "<%u.%u.%u>",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue