Skip to content

Commit

Permalink
tipc: some cleanups in the file discover.c
Browse files Browse the repository at this point in the history
To facilitate the coming changes in the neighbor discovery functionality
we make some renaming and refactoring of that code. The functional changes
in this commit are trivial, e.g., that we move the message sending call in
tipc_disc_timeout() outside the spinlock protected region.

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>
  • Loading branch information
Jon Maloy authored and David S. Miller committed Mar 23, 2018
1 parent cb30a63 commit b39e465
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 166 deletions.
8 changes: 4 additions & 4 deletions net/tipc/bearer.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ void tipc_bearer_add_dest(struct net *net, u32 bearer_id, u32 dest)
rcu_read_lock();
b = rcu_dereference_rtnl(tn->bearer_list[bearer_id]);
if (b)
tipc_disc_add_dest(b->link_req);
tipc_disc_add_dest(b->disc);
rcu_read_unlock();
}

Expand All @@ -222,7 +222,7 @@ void tipc_bearer_remove_dest(struct net *net, u32 bearer_id, u32 dest)
rcu_read_lock();
b = rcu_dereference_rtnl(tn->bearer_list[bearer_id]);
if (b)
tipc_disc_remove_dest(b->link_req);
tipc_disc_remove_dest(b->disc);
rcu_read_unlock();
}

Expand Down Expand Up @@ -389,8 +389,8 @@ static void bearer_disable(struct net *net, struct tipc_bearer *b)
tipc_node_delete_links(net, bearer_id);
b->media->disable_media(b);
RCU_INIT_POINTER(b->media_ptr, NULL);
if (b->link_req)
tipc_disc_delete(b->link_req);
if (b->disc)
tipc_disc_delete(b->disc);
RCU_INIT_POINTER(tn->bearer_list[bearer_id], NULL);
kfree_rcu(b, rcu);
tipc_mon_delete(net, bearer_id);
Expand Down
2 changes: 1 addition & 1 deletion net/tipc/bearer.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ struct tipc_bearer {
u32 tolerance;
u32 domain;
u32 identity;
struct tipc_link_req *link_req;
struct tipc_discoverer *disc;
char net_plane;
unsigned long up;
};
Expand Down
Loading

0 comments on commit b39e465

Please sign in to comment.