diff options
author | Jon Maloy <jon.maloy@ericsson.com> | 2018-02-15 10:40:45 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-16 15:26:33 -0500 |
commit | 414574a0af36d329f560f542e650cc4a81cc1d69 (patch) | |
tree | f4a319ea2214e6fb3f8a12521001bf0b50add3a2 /net/tipc/name_table.c | |
parent | df79d040dcd7d7e580c50edf40b82e677fe84801 (diff) | |
download | linux-rpi-414574a0af36d329f560f542e650cc4a81cc1d69.tar.gz linux-rpi-414574a0af36d329f560f542e650cc4a81cc1d69.tar.bz2 linux-rpi-414574a0af36d329f560f542e650cc4a81cc1d69.zip |
tipc: simplify interaction between subscription and topology connection
The message transmission and reception in the topology server is more
generic than is currently necessary. By basing the funtionality on the
fact that we only send items of type struct tipc_event and always
receive items of struct tipc_subcr we can make several simplifications,
and also get rid of some unnecessary dynamic memory allocations.
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>
Diffstat (limited to 'net/tipc/name_table.c')
-rw-r--r-- | net/tipc/name_table.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index ed0457cc99d6..c0ca7be46f7a 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c @@ -810,14 +810,15 @@ int tipc_nametbl_withdraw(struct net *net, u32 type, u32 lower, u32 ref, */ void tipc_nametbl_subscribe(struct tipc_subscription *s, bool status) { - struct tipc_net *tn = net_generic(s->net, tipc_net_id); + struct tipc_server *srv = s->server; + struct tipc_net *tn = tipc_net(srv->net); u32 type = tipc_subscrp_convert_seq_type(s->evt.s.seq.type, s->swap); int index = hash(type); struct name_seq *seq; struct tipc_name_seq ns; spin_lock_bh(&tn->nametbl_lock); - seq = nametbl_find_seq(s->net, type); + seq = nametbl_find_seq(srv->net, type); if (!seq) seq = tipc_nameseq_create(type, &tn->nametbl->seq_hlist[index]); if (seq) { @@ -837,12 +838,13 @@ void tipc_nametbl_subscribe(struct tipc_subscription *s, bool status) */ void tipc_nametbl_unsubscribe(struct tipc_subscription *s) { - struct tipc_net *tn = net_generic(s->net, tipc_net_id); + struct tipc_server *srv = s->server; + struct tipc_net *tn = tipc_net(srv->net); struct name_seq *seq; u32 type = tipc_subscrp_convert_seq_type(s->evt.s.seq.type, s->swap); spin_lock_bh(&tn->nametbl_lock); - seq = nametbl_find_seq(s->net, type); + seq = nametbl_find_seq(srv->net, type); if (seq != NULL) { spin_lock_bh(&seq->lock); list_del_init(&s->nameseq_list); |