On 03/13/2018 09:24 PM, Jon Maloy wrote:
> The size of struct publication can be reduced further. Membership in
> lists 'nodesub_list' and 'local_list' is mutually exlusive, in that
> remote publications use the former and local publications the latter.
> We replace the two lists with one single, named 'issuing_node' which
> reflects what it really is.
> 
> Signed-off-by: Jon Maloy <[email protected]>

Acked-by: Ying Xue <[email protected]>

> ---
>  net/tipc/name_distr.c | 20 ++++++++++----------
>  net/tipc/name_table.h |  3 +--
>  2 files changed, 11 insertions(+), 12 deletions(-)
> 
> diff --git a/net/tipc/name_distr.c b/net/tipc/name_distr.c
> index 11ce205..c4a7827 100644
> --- a/net/tipc/name_distr.c
> +++ b/net/tipc/name_distr.c
> @@ -91,10 +91,10 @@ struct sk_buff *tipc_named_publish(struct net *net, 
> struct publication *publ)
>       struct sk_buff *skb;
>  
>       if (publ->scope == TIPC_NODE_SCOPE) {
> -             list_add_tail_rcu(&publ->local_list, &nt->node_scope);
> +             list_add_tail_rcu(&publ->issuing_node, &nt->node_scope);
>               return NULL;
>       }
> -     list_add_tail_rcu(&publ->local_list, &nt->cluster_scope);
> +     list_add_tail_rcu(&publ->issuing_node, &nt->cluster_scope);
>  
>       skb = named_prepare_buf(net, PUBLICATION, ITEM_SIZE, 0);
>       if (!skb) {
> @@ -115,7 +115,7 @@ struct sk_buff *tipc_named_withdraw(struct net *net, 
> struct publication *publ)
>       struct sk_buff *buf;
>       struct distr_item *item;
>  
> -     list_del(&publ->local_list);
> +     list_del(&publ->issuing_node);
>  
>       if (publ->scope == TIPC_NODE_SCOPE)
>               return NULL;
> @@ -147,7 +147,7 @@ static void named_distribute(struct net *net, struct 
> sk_buff_head *list,
>                       ITEM_SIZE) * ITEM_SIZE;
>       u32 msg_rem = msg_dsz;
>  
> -     list_for_each_entry(publ, pls, local_list) {
> +     list_for_each_entry(publ, pls, issuing_node) {
>               /* Prepare next buffer: */
>               if (!skb) {
>                       skb = named_prepare_buf(net, PUBLICATION, msg_rem,
> @@ -211,7 +211,7 @@ static void tipc_publ_purge(struct net *net, struct 
> publication *publ, u32 addr)
>       p = tipc_nametbl_remove_publ(net, publ->type, publ->lower,
>                                    publ->node, publ->ref, publ->key);
>       if (p)
> -             tipc_node_unsubscribe(net, &p->nodesub_list, addr);
> +             tipc_node_unsubscribe(net, &p->issuing_node, addr);
>       spin_unlock_bh(&tn->nametbl_lock);
>  
>       if (p != publ) {
> @@ -246,7 +246,7 @@ void tipc_publ_notify(struct net *net, struct list_head 
> *nsub_list, u32 addr)
>  {
>       struct publication *publ, *tmp;
>  
> -     list_for_each_entry_safe(publ, tmp, nsub_list, nodesub_list)
> +     list_for_each_entry_safe(publ, tmp, nsub_list, issuing_node)
>               tipc_publ_purge(net, publ, addr);
>       tipc_dist_queue_purge(net, addr);
>  }
> @@ -270,7 +270,7 @@ static bool tipc_update_nametbl(struct net *net, struct 
> distr_item *i,
>                                               TIPC_CLUSTER_SCOPE, node,
>                                               ntohl(i->ref), ntohl(i->key));
>               if (publ) {
> -                     tipc_node_subscribe(net, &publ->nodesub_list, node);
> +                     tipc_node_subscribe(net, &publ->issuing_node, node);
>                       return true;
>               }
>       } else if (dtype == WITHDRAWAL) {
> @@ -279,7 +279,7 @@ static bool tipc_update_nametbl(struct net *net, struct 
> distr_item *i,
>                                               node, ntohl(i->ref),
>                                               ntohl(i->key));
>               if (publ) {
> -                     tipc_node_unsubscribe(net, &publ->nodesub_list, node);
> +                     tipc_node_unsubscribe(net, &publ->issuing_node, node);
>                       kfree_rcu(publ, rcu);
>                       return true;
>               }
> @@ -385,9 +385,9 @@ void tipc_named_reinit(struct net *net)
>  
>       spin_lock_bh(&tn->nametbl_lock);
>  
> -     list_for_each_entry_rcu(publ, &nt->node_scope, local_list)
> +     list_for_each_entry_rcu(publ, &nt->node_scope, issuing_node)
>               publ->node = tn->own_addr;
> -     list_for_each_entry_rcu(publ, &nt->cluster_scope, local_list)
> +     list_for_each_entry_rcu(publ, &nt->cluster_scope, issuing_node)
>               publ->node = tn->own_addr;
>  
>       spin_unlock_bh(&tn->nametbl_lock);
> diff --git a/net/tipc/name_table.h b/net/tipc/name_table.h
> index a9063e2..c32602d 100644
> --- a/net/tipc/name_table.h
> +++ b/net/tipc/name_table.h
> @@ -76,8 +76,7 @@ struct publication {
>       u32 node;
>       u32 ref;
>       u32 key;
> -     struct list_head nodesub_list;
> -     struct list_head local_list;
> +     struct list_head issuing_node;
>       struct list_head pport_list;
>       struct list_head node_list;
>       struct list_head cluster_list;
> 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
tipc-discussion mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tipc-discussion

Reply via email to