Commit 57f1d186 authored by Ying Xue's avatar Ying Xue Committed by David S. Miller

tipc: rename functions defined in subscr.c

When a topology server accepts a connection request from its client,
it allocates a connection instance and a tipc_subscriber structure
object. The former is used to communicate with client, and the latter
is often treated as a subscriber which manages all subscription events
requested from a same client. When a topology server receives a request
of subscribing name services from a client through the connection, it
creates a tipc_subscription structure instance which is seen as a
subscription recording what name services are subscribed. In order to
manage all subscriptions from a same client, topology server links
them into the subscrp_list of the subscriber. So subscriber and
subscription completely represents different meanings respectively,
but function names associated with them make us so confused that we
are unable to easily tell which function is against subscriber and
which is to subscription. So we want to eliminate the confusion by
renaming them.
Signed-off-by: default avatarYing Xue <ying.xue@windriver.com>
Reviewed-by: default avatarJon Maloy <jon.maloy@ericson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 29a1ff65
...@@ -68,7 +68,7 @@ static int __net_init tipc_init_net(struct net *net) ...@@ -68,7 +68,7 @@ static int __net_init tipc_init_net(struct net *net)
if (err) if (err)
goto out_nametbl; goto out_nametbl;
err = tipc_subscr_start(net); err = tipc_topsrv_start(net);
if (err) if (err)
goto out_subscr; goto out_subscr;
return 0; return 0;
...@@ -83,7 +83,7 @@ static int __net_init tipc_init_net(struct net *net) ...@@ -83,7 +83,7 @@ static int __net_init tipc_init_net(struct net *net)
static void __net_exit tipc_exit_net(struct net *net) static void __net_exit tipc_exit_net(struct net *net)
{ {
tipc_subscr_stop(net); tipc_topsrv_stop(net);
tipc_net_stop(net); tipc_net_stop(net);
tipc_nametbl_stop(net); tipc_nametbl_stop(net);
tipc_sk_rht_destroy(net); tipc_sk_rht_destroy(net);
......
...@@ -330,13 +330,9 @@ static struct publication *tipc_nameseq_insert_publ(struct net *net, ...@@ -330,13 +330,9 @@ static struct publication *tipc_nameseq_insert_publ(struct net *net,
/* Any subscriptions waiting for notification? */ /* Any subscriptions waiting for notification? */
list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) { list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) {
tipc_subscr_report_overlap(s, tipc_subscrp_report_overlap(s, publ->lower, publ->upper,
publ->lower, TIPC_PUBLISHED, publ->ref,
publ->upper, publ->node, created_subseq);
TIPC_PUBLISHED,
publ->ref,
publ->node,
created_subseq);
} }
return publ; return publ;
} }
...@@ -404,13 +400,9 @@ static struct publication *tipc_nameseq_remove_publ(struct net *net, ...@@ -404,13 +400,9 @@ static struct publication *tipc_nameseq_remove_publ(struct net *net,
/* Notify any waiting subscriptions */ /* Notify any waiting subscriptions */
list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) { list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) {
tipc_subscr_report_overlap(s, tipc_subscrp_report_overlap(s, publ->lower, publ->upper,
publ->lower, TIPC_WITHDRAWN, publ->ref,
publ->upper, publ->node, removed_subseq);
TIPC_WITHDRAWN,
publ->ref,
publ->node,
removed_subseq);
} }
return publ; return publ;
...@@ -432,19 +424,17 @@ static void tipc_nameseq_subscribe(struct name_seq *nseq, ...@@ -432,19 +424,17 @@ static void tipc_nameseq_subscribe(struct name_seq *nseq,
return; return;
while (sseq != &nseq->sseqs[nseq->first_free]) { while (sseq != &nseq->sseqs[nseq->first_free]) {
if (tipc_subscr_overlap(s, sseq->lower, sseq->upper)) { if (tipc_subscrp_check_overlap(s, sseq->lower, sseq->upper)) {
struct publication *crs; struct publication *crs;
struct name_info *info = sseq->info; struct name_info *info = sseq->info;
int must_report = 1; int must_report = 1;
list_for_each_entry(crs, &info->zone_list, zone_list) { list_for_each_entry(crs, &info->zone_list, zone_list) {
tipc_subscr_report_overlap(s, tipc_subscrp_report_overlap(s, sseq->lower,
sseq->lower, sseq->upper,
sseq->upper, TIPC_PUBLISHED,
TIPC_PUBLISHED, crs->ref, crs->node,
crs->ref, must_report);
crs->node,
must_report);
must_report = 0; must_report = 0;
} }
} }
......
This diff is collapsed.
...@@ -54,7 +54,7 @@ struct tipc_subscriber; ...@@ -54,7 +54,7 @@ struct tipc_subscriber;
* @filter: event filtering to be done for subscription * @filter: event filtering to be done for subscription
* @timer: timer governing subscription duration (optional) * @timer: timer governing subscription duration (optional)
* @nameseq_list: adjacent subscriptions in name sequence's subscription list * @nameseq_list: adjacent subscriptions in name sequence's subscription list
* @subscription_list: adjacent subscriptions in subscriber's subscription list * @subscrp_list: adjacent subscriptions in subscriber's subscription list
* @server_ref: object reference of server port associated with subscription * @server_ref: object reference of server port associated with subscription
* @swap: indicates if subscriber uses opposite endianness in its messages * @swap: indicates if subscriber uses opposite endianness in its messages
* @evt: template for events generated by subscription * @evt: template for events generated by subscription
...@@ -67,17 +67,17 @@ struct tipc_subscription { ...@@ -67,17 +67,17 @@ struct tipc_subscription {
u32 filter; u32 filter;
struct timer_list timer; struct timer_list timer;
struct list_head nameseq_list; struct list_head nameseq_list;
struct list_head subscription_list; struct list_head subscrp_list;
int swap; int swap;
struct tipc_event evt; struct tipc_event evt;
}; };
int tipc_subscr_overlap(struct tipc_subscription *sub, u32 found_lower, int tipc_subscrp_check_overlap(struct tipc_subscription *sub, u32 found_lower,
u32 found_upper); u32 found_upper);
void tipc_subscr_report_overlap(struct tipc_subscription *sub, u32 found_lower, void tipc_subscrp_report_overlap(struct tipc_subscription *sub,
u32 found_upper, u32 event, u32 port_ref, u32 found_lower, u32 found_upper, u32 event,
u32 node, int must); u32 port_ref, u32 node, int must);
int tipc_subscr_start(struct net *net); int tipc_topsrv_start(struct net *net);
void tipc_subscr_stop(struct net *net); void tipc_topsrv_stop(struct net *net);
#endif #endif
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