From 0043550b0a88b72216161d6f25eb0a2e0e78babf Mon Sep 17 00:00:00 2001 From: Jon Paul Maloy Date: Thu, 22 Oct 2015 08:51:34 -0400 Subject: tipc: move broadcast link lock to struct tipc_net The broadcast lock will need to be acquired outside bcast.c in a later commit. For this reason, we move the lock to struct tipc_net. Consistent with the changes in the previous commit, we also introducee two new functions tipc_bcast_lock() and tipc_bcast_unlock(). The code that is currently using tipc_bclink_lock()/unlock() will be phased out during the coming commits in this series. Signed-off-by: Jon Maloy Reviewed-by: Ying Xue Signed-off-by: David S. Miller --- net/tipc/bcast.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'net/tipc/bcast.h') diff --git a/net/tipc/bcast.h b/net/tipc/bcast.h index d379b0afe8e8..eac912abacd2 100644 --- a/net/tipc/bcast.h +++ b/net/tipc/bcast.h @@ -69,4 +69,14 @@ int tipc_nl_bc_link_set(struct net *net, struct nlattr *attrs[]); void tipc_bclink_input(struct net *net); void tipc_bclink_sync_state(struct tipc_node *n, struct tipc_msg *msg); +static inline void tipc_bcast_lock(struct net *net) +{ + spin_lock_bh(&tipc_net(net)->bclock); +} + +static inline void tipc_bcast_unlock(struct net *net) +{ + spin_unlock_bh(&tipc_net(net)->bclock); +} + #endif -- cgit v1.2.3