Skip to content

Commit

Permalink
Merge branch 'tipc-topology-cleanup'
Browse files Browse the repository at this point in the history
Ying Xue says:

====================
tipc: cleanup topology server

Not only function names declared in subscr.c are very confused, but
also topology server's locking policy is not designed very well, for
instance, usually leading to panic in some special corner cases.

In this series, we attempt to eliminate the confusion of function names
and simplify topology server's locking policy to solve above mentioned
issues. More importantly, the change will make relevant code easily
understandable and maintainable.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
davem330 committed May 4, 2015
2 parents 29a1ff6 + 90bdfcb commit c373dac
Show file tree
Hide file tree
Showing 5 changed files with 137 additions and 165 deletions.
4 changes: 2 additions & 2 deletions net/tipc/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static int __net_init tipc_init_net(struct net *net)
if (err)
goto out_nametbl;

err = tipc_subscr_start(net);
err = tipc_topsrv_start(net);
if (err)
goto out_subscr;
return 0;
Expand All @@ -83,7 +83,7 @@ static int __net_init tipc_init_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_nametbl_stop(net);
tipc_sk_rht_destroy(net);
Expand Down
34 changes: 12 additions & 22 deletions net/tipc/name_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,9 @@ static struct publication *tipc_nameseq_insert_publ(struct net *net,

/* Any subscriptions waiting for notification? */
list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) {
tipc_subscr_report_overlap(s,
publ->lower,
publ->upper,
TIPC_PUBLISHED,
publ->ref,
publ->node,
created_subseq);
tipc_subscrp_report_overlap(s, publ->lower, publ->upper,
TIPC_PUBLISHED, publ->ref,
publ->node, created_subseq);
}
return publ;
}
Expand Down Expand Up @@ -404,13 +400,9 @@ static struct publication *tipc_nameseq_remove_publ(struct net *net,

/* Notify any waiting subscriptions */
list_for_each_entry_safe(s, st, &nseq->subscriptions, nameseq_list) {
tipc_subscr_report_overlap(s,
publ->lower,
publ->upper,
TIPC_WITHDRAWN,
publ->ref,
publ->node,
removed_subseq);
tipc_subscrp_report_overlap(s, publ->lower, publ->upper,
TIPC_WITHDRAWN, publ->ref,
publ->node, removed_subseq);
}

return publ;
Expand All @@ -432,19 +424,17 @@ static void tipc_nameseq_subscribe(struct name_seq *nseq,
return;

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 name_info *info = sseq->info;
int must_report = 1;

list_for_each_entry(crs, &info->zone_list, zone_list) {
tipc_subscr_report_overlap(s,
sseq->lower,
sseq->upper,
TIPC_PUBLISHED,
crs->ref,
crs->node,
must_report);
tipc_subscrp_report_overlap(s, sseq->lower,
sseq->upper,
TIPC_PUBLISHED,
crs->ref, crs->node,
must_report);
must_report = 0;
}
}
Expand Down
4 changes: 4 additions & 0 deletions net/tipc/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ static int tipc_accept_from_sock(struct tipc_conn *con)

/* Notify that new connection is incoming */
newcon->usr_data = s->tipc_conn_new(newcon->conid);
if (!newcon->usr_data) {
sock_release(newsock);
return -ENOMEM;
}

/* Wake up receive process in case of 'SYN+' message */
newsock->sk->sk_data_ready(newsock->sk);
Expand Down
Loading

0 comments on commit c373dac

Please sign in to comment.