Commit e50e73e1 authored by Jon Maloy's avatar Jon Maloy Committed by David S. Miller

tipc: some name changes

We rename some lists and fields in struct publication both to make
the naming more consistent and to better reflect their roles. We
also update the descriptions of those lists.

node_list -> local_publ
cluster_list -> all_publ
pport_list -> binding_sock
ref -> port

There are no functional changes in this commit.
Acked-by: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 935439cc
...@@ -56,7 +56,7 @@ static void publ_to_item(struct distr_item *i, struct publication *p) ...@@ -56,7 +56,7 @@ static void publ_to_item(struct distr_item *i, struct publication *p)
i->type = htonl(p->type); i->type = htonl(p->type);
i->lower = htonl(p->lower); i->lower = htonl(p->lower);
i->upper = htonl(p->upper); i->upper = htonl(p->upper);
i->ref = htonl(p->ref); i->port = htonl(p->port);
i->key = htonl(p->key); i->key = htonl(p->key);
} }
...@@ -209,15 +209,15 @@ static void tipc_publ_purge(struct net *net, struct publication *publ, u32 addr) ...@@ -209,15 +209,15 @@ static void tipc_publ_purge(struct net *net, struct publication *publ, u32 addr)
spin_lock_bh(&tn->nametbl_lock); spin_lock_bh(&tn->nametbl_lock);
p = tipc_nametbl_remove_publ(net, publ->type, publ->lower, p = tipc_nametbl_remove_publ(net, publ->type, publ->lower,
publ->node, publ->ref, publ->key); publ->node, publ->port, publ->key);
if (p) if (p)
tipc_node_unsubscribe(net, &p->binding_node, addr); tipc_node_unsubscribe(net, &p->binding_node, addr);
spin_unlock_bh(&tn->nametbl_lock); spin_unlock_bh(&tn->nametbl_lock);
if (p != publ) { if (p != publ) {
pr_err("Unable to remove publication from failed node\n" pr_err("Unable to remove publication from failed node\n"
" (type=%u, lower=%u, node=0x%x, ref=%u, key=%u)\n", " (type=%u, lower=%u, node=0x%x, port=%u, key=%u)\n",
publ->type, publ->lower, publ->node, publ->ref, publ->type, publ->lower, publ->node, publ->port,
publ->key); publ->key);
} }
...@@ -268,7 +268,7 @@ static bool tipc_update_nametbl(struct net *net, struct distr_item *i, ...@@ -268,7 +268,7 @@ static bool tipc_update_nametbl(struct net *net, struct distr_item *i,
ntohl(i->lower), ntohl(i->lower),
ntohl(i->upper), ntohl(i->upper),
TIPC_CLUSTER_SCOPE, node, TIPC_CLUSTER_SCOPE, node,
ntohl(i->ref), ntohl(i->key)); ntohl(i->port), ntohl(i->key));
if (publ) { if (publ) {
tipc_node_subscribe(net, &publ->binding_node, node); tipc_node_subscribe(net, &publ->binding_node, node);
return true; return true;
...@@ -276,7 +276,7 @@ static bool tipc_update_nametbl(struct net *net, struct distr_item *i, ...@@ -276,7 +276,7 @@ static bool tipc_update_nametbl(struct net *net, struct distr_item *i,
} else if (dtype == WITHDRAWAL) { } else if (dtype == WITHDRAWAL) {
publ = tipc_nametbl_remove_publ(net, ntohl(i->type), publ = tipc_nametbl_remove_publ(net, ntohl(i->type),
ntohl(i->lower), ntohl(i->lower),
node, ntohl(i->ref), node, ntohl(i->port),
ntohl(i->key)); ntohl(i->key));
if (publ) { if (publ) {
tipc_node_unsubscribe(net, &publ->binding_node, node); tipc_node_unsubscribe(net, &publ->binding_node, node);
......
...@@ -63,7 +63,7 @@ struct distr_item { ...@@ -63,7 +63,7 @@ struct distr_item {
__be32 type; __be32 type;
__be32 lower; __be32 lower;
__be32 upper; __be32 upper;
__be32 ref; __be32 port;
__be32 key; __be32 key;
}; };
......
This diff is collapsed.
...@@ -54,19 +54,22 @@ struct tipc_group; ...@@ -54,19 +54,22 @@ struct tipc_group;
* @type: name sequence type * @type: name sequence type
* @lower: name sequence lower bound * @lower: name sequence lower bound
* @upper: name sequence upper bound * @upper: name sequence upper bound
* @scope: scope of publication * @scope: scope of publication, TIPC_NODE_SCOPE or TIPC_CLUSTER_SCOPE
* @node: network address of publishing port's node * @node: network address of publishing socket's node
* @ref: publishing port * @port: publishing port
* @key: publication key * @key: publication key, unique across the cluster
* @nodesub_list: subscription to "node down" event (off-node publication only) * @binding_node: all publications from the same node which bound this one
* @local_list: adjacent entries in list of publications made by this node * - Remote publications: in node->publ_list
* @pport_list: adjacent entries in list of publications made by this port * Used by node/name distr to withdraw publications when node is lost
* @node_list: adjacent matching name seq publications with >= node scope * - Local/node scope publications: in name_table->node_scope list
* @cluster_list: adjacent matching name seq publications with >= cluster scope * - Local/cluster scope publications: in name_table->cluster_scope list
* @zone_list: adjacent matching name seq publications with >= zone scope * @binding_sock: all publications from the same socket which bound this one
* Used by socket to withdraw publications when socket is unbound/released
* @local_publ: list of identical publications made from this node
* Used by closest_first and multicast receive lookup algorithms
* @all_publ: all publications identical to this one, whatever node and scope
* Used by round-robin lookup algorithm
* @rcu: RCU callback head used for deferred freeing * @rcu: RCU callback head used for deferred freeing
*
* Note that the node list, cluster list, and zone list are circular lists.
*/ */
struct publication { struct publication {
u32 type; u32 type;
...@@ -74,12 +77,12 @@ struct publication { ...@@ -74,12 +77,12 @@ struct publication {
u32 upper; u32 upper;
u32 scope; u32 scope;
u32 node; u32 node;
u32 ref; u32 port;
u32 key; u32 key;
struct list_head binding_node; struct list_head binding_node;
struct list_head pport_list; struct list_head binding_sock;
struct list_head node_list; struct list_head local_publ;
struct list_head cluster_list; struct list_head all_publ;
struct rcu_head rcu; struct rcu_head rcu;
}; };
...@@ -87,7 +90,10 @@ struct publication { ...@@ -87,7 +90,10 @@ struct publication {
* struct name_table - table containing all existing port name publications * struct name_table - table containing all existing port name publications
* @seq_hlist: name sequence hash lists * @seq_hlist: name sequence hash lists
* @node_scope: all local publications with node scope * @node_scope: all local publications with node scope
* - used by name_distr during re-init of name table
* @cluster_scope: all local publications with cluster scope * @cluster_scope: all local publications with cluster scope
* - used by name_distr to send bulk updates to new nodes
* - used by name_distr during re-init of name table
* @local_publ_count: number of publications issued by this node * @local_publ_count: number of publications issued by this node
*/ */
struct name_table { struct name_table {
......
...@@ -2605,7 +2605,7 @@ static int tipc_sk_publish(struct tipc_sock *tsk, uint scope, ...@@ -2605,7 +2605,7 @@ static int tipc_sk_publish(struct tipc_sock *tsk, uint scope,
if (unlikely(!publ)) if (unlikely(!publ))
return -EINVAL; return -EINVAL;
list_add(&publ->pport_list, &tsk->publications); list_add(&publ->binding_sock, &tsk->publications);
tsk->pub_count++; tsk->pub_count++;
tsk->published = 1; tsk->published = 1;
return 0; return 0;
...@@ -2622,7 +2622,7 @@ static int tipc_sk_withdraw(struct tipc_sock *tsk, uint scope, ...@@ -2622,7 +2622,7 @@ static int tipc_sk_withdraw(struct tipc_sock *tsk, uint scope,
if (scope != TIPC_NODE_SCOPE) if (scope != TIPC_NODE_SCOPE)
scope = TIPC_CLUSTER_SCOPE; scope = TIPC_CLUSTER_SCOPE;
list_for_each_entry_safe(publ, safe, &tsk->publications, pport_list) { list_for_each_entry_safe(publ, safe, &tsk->publications, binding_sock) {
if (seq) { if (seq) {
if (publ->scope != scope) if (publ->scope != scope)
continue; continue;
...@@ -2633,12 +2633,12 @@ static int tipc_sk_withdraw(struct tipc_sock *tsk, uint scope, ...@@ -2633,12 +2633,12 @@ static int tipc_sk_withdraw(struct tipc_sock *tsk, uint scope,
if (publ->upper != seq->upper) if (publ->upper != seq->upper)
break; break;
tipc_nametbl_withdraw(net, publ->type, publ->lower, tipc_nametbl_withdraw(net, publ->type, publ->lower,
publ->ref, publ->key); publ->port, publ->key);
rc = 0; rc = 0;
break; break;
} }
tipc_nametbl_withdraw(net, publ->type, publ->lower, tipc_nametbl_withdraw(net, publ->type, publ->lower,
publ->ref, publ->key); publ->port, publ->key);
rc = 0; rc = 0;
} }
if (list_empty(&tsk->publications)) if (list_empty(&tsk->publications))
...@@ -3292,7 +3292,7 @@ static int __tipc_nl_list_sk_publ(struct sk_buff *skb, ...@@ -3292,7 +3292,7 @@ static int __tipc_nl_list_sk_publ(struct sk_buff *skb,
struct publication *p; struct publication *p;
if (*last_publ) { if (*last_publ) {
list_for_each_entry(p, &tsk->publications, pport_list) { list_for_each_entry(p, &tsk->publications, binding_sock) {
if (p->key == *last_publ) if (p->key == *last_publ)
break; break;
} }
...@@ -3309,10 +3309,10 @@ static int __tipc_nl_list_sk_publ(struct sk_buff *skb, ...@@ -3309,10 +3309,10 @@ static int __tipc_nl_list_sk_publ(struct sk_buff *skb,
} }
} else { } else {
p = list_first_entry(&tsk->publications, struct publication, p = list_first_entry(&tsk->publications, struct publication,
pport_list); binding_sock);
} }
list_for_each_entry_from(p, &tsk->publications, pport_list) { list_for_each_entry_from(p, &tsk->publications, binding_sock) {
err = __tipc_nl_add_sk_publ(skb, cb, p); err = __tipc_nl_add_sk_publ(skb, cb, p);
if (err) { if (err) {
*last_publ = p->key; *last_publ = p->key;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment