aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorYing Xue <ying.xue@windriver.com>2014-04-20 22:55:42 -0400
committerDavid S. Miller <davem@davemloft.net>2014-04-22 21:17:52 -0400
commitef13a262c339544a81e3ba8d15ee345641593da4 (patch)
tree52b94dff9309959456d0b52136b8cab94cd6e519 /net/tipc
parent5a9d19ab76f98b7cdc97ba9724be01deba791bc0 (diff)
tipc: replace config_mutex lock with RTNL lock
There have two paths where we can configure or change bearer status: one is that bearer is configured from user space with tipc-config tool; another one is that bearer is changed by notification events from its attached interface. On the first path, one dedicated config_mutex lock is guarded; on the latter path, RTNL lock has been placed to serialize the process of dealing with interface events. So, if RTNL lock is also used to protect the first path, this will not only extremely help us simplify current locking policy, but also config_mutex lock can be deleted as well. Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Tested-by: Erik Hugne <erik.hugne@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/config.c6
-rw-r--r--net/tipc/core.h2
2 files changed, 3 insertions, 5 deletions
diff --git a/net/tipc/config.c b/net/tipc/config.c
index 4b981c053823..251f5a2028e4 100644
--- a/net/tipc/config.c
+++ b/net/tipc/config.c
@@ -42,8 +42,6 @@
42 42
43#define REPLY_TRUNCATED "<truncated>\n" 43#define REPLY_TRUNCATED "<truncated>\n"
44 44
45static DEFINE_MUTEX(config_mutex);
46
47static const void *req_tlv_area; /* request message TLV area */ 45static const void *req_tlv_area; /* request message TLV area */
48static int req_tlv_space; /* request message TLV area size */ 46static int req_tlv_space; /* request message TLV area size */
49static int rep_headroom; /* reply message headroom to use */ 47static int rep_headroom; /* reply message headroom to use */
@@ -223,7 +221,7 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
223{ 221{
224 struct sk_buff *rep_tlv_buf; 222 struct sk_buff *rep_tlv_buf;
225 223
226 mutex_lock(&config_mutex); 224 rtnl_lock();
227 225
228 /* Save request and reply details in a well-known location */ 226 /* Save request and reply details in a well-known location */
229 req_tlv_area = request_area; 227 req_tlv_area = request_area;
@@ -337,6 +335,6 @@ struct sk_buff *tipc_cfg_do_cmd(u32 orig_node, u16 cmd, const void *request_area
337 335
338 /* Return reply buffer */ 336 /* Return reply buffer */
339exit: 337exit:
340 mutex_unlock(&config_mutex); 338 rtnl_unlock();
341 return rep_tlv_buf; 339 return rep_tlv_buf;
342} 340}
diff --git a/net/tipc/core.h b/net/tipc/core.h
index 8985bbcb942b..36cbf158845f 100644
--- a/net/tipc/core.h
+++ b/net/tipc/core.h
@@ -56,7 +56,7 @@
56#include <linux/list.h> 56#include <linux/list.h>
57#include <linux/slab.h> 57#include <linux/slab.h>
58#include <linux/vmalloc.h> 58#include <linux/vmalloc.h>
59 59#include <linux/rtnetlink.h>
60 60
61#define TIPC_MOD_VER "2.0.0" 61#define TIPC_MOD_VER "2.0.0"
62 62