Commit b39e465e authored by Jon Maloy's avatar Jon Maloy Committed by David S. Miller

tipc: some cleanups in the file discover.c

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: default avatarYing Xue <ying.xue@windriver.com>
Signed-off-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cb30a633
...@@ -210,7 +210,7 @@ void tipc_bearer_add_dest(struct net *net, u32 bearer_id, u32 dest) ...@@ -210,7 +210,7 @@ void tipc_bearer_add_dest(struct net *net, u32 bearer_id, u32 dest)
rcu_read_lock(); rcu_read_lock();
b = rcu_dereference_rtnl(tn->bearer_list[bearer_id]); b = rcu_dereference_rtnl(tn->bearer_list[bearer_id]);
if (b) if (b)
tipc_disc_add_dest(b->link_req); tipc_disc_add_dest(b->disc);
rcu_read_unlock(); rcu_read_unlock();
} }
...@@ -222,7 +222,7 @@ void tipc_bearer_remove_dest(struct net *net, u32 bearer_id, u32 dest) ...@@ -222,7 +222,7 @@ void tipc_bearer_remove_dest(struct net *net, u32 bearer_id, u32 dest)
rcu_read_lock(); rcu_read_lock();
b = rcu_dereference_rtnl(tn->bearer_list[bearer_id]); b = rcu_dereference_rtnl(tn->bearer_list[bearer_id]);
if (b) if (b)
tipc_disc_remove_dest(b->link_req); tipc_disc_remove_dest(b->disc);
rcu_read_unlock(); rcu_read_unlock();
} }
...@@ -389,8 +389,8 @@ static void bearer_disable(struct net *net, struct tipc_bearer *b) ...@@ -389,8 +389,8 @@ static void bearer_disable(struct net *net, struct tipc_bearer *b)
tipc_node_delete_links(net, bearer_id); tipc_node_delete_links(net, bearer_id);
b->media->disable_media(b); b->media->disable_media(b);
RCU_INIT_POINTER(b->media_ptr, NULL); RCU_INIT_POINTER(b->media_ptr, NULL);
if (b->link_req) if (b->disc)
tipc_disc_delete(b->link_req); tipc_disc_delete(b->disc);
RCU_INIT_POINTER(tn->bearer_list[bearer_id], NULL); RCU_INIT_POINTER(tn->bearer_list[bearer_id], NULL);
kfree_rcu(b, rcu); kfree_rcu(b, rcu);
tipc_mon_delete(net, bearer_id); tipc_mon_delete(net, bearer_id);
......
...@@ -159,7 +159,7 @@ struct tipc_bearer { ...@@ -159,7 +159,7 @@ struct tipc_bearer {
u32 tolerance; u32 tolerance;
u32 domain; u32 domain;
u32 identity; u32 identity;
struct tipc_link_req *link_req; struct tipc_discoverer *disc;
char net_plane; char net_plane;
unsigned long up; unsigned long up;
}; };
......
This diff is collapsed.
...@@ -37,14 +37,14 @@ ...@@ -37,14 +37,14 @@
#ifndef _TIPC_DISCOVER_H #ifndef _TIPC_DISCOVER_H
#define _TIPC_DISCOVER_H #define _TIPC_DISCOVER_H
struct tipc_link_req; struct tipc_discoverer;
int tipc_disc_create(struct net *net, struct tipc_bearer *b_ptr, int tipc_disc_create(struct net *net, struct tipc_bearer *b_ptr,
struct tipc_media_addr *dest, struct sk_buff **skb); struct tipc_media_addr *dest, struct sk_buff **skb);
void tipc_disc_delete(struct tipc_link_req *req); void tipc_disc_delete(struct tipc_discoverer *req);
void tipc_disc_reset(struct net *net, struct tipc_bearer *b_ptr); void tipc_disc_reset(struct net *net, struct tipc_bearer *b_ptr);
void tipc_disc_add_dest(struct tipc_link_req *req); void tipc_disc_add_dest(struct tipc_discoverer *req);
void tipc_disc_remove_dest(struct tipc_link_req *req); void tipc_disc_remove_dest(struct tipc_discoverer *req);
void tipc_disc_rcv(struct net *net, struct sk_buff *buf, void tipc_disc_rcv(struct net *net, struct sk_buff *buf,
struct tipc_bearer *b_ptr); struct tipc_bearer *b_ptr);
......
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