diff options
Diffstat (limited to 'net/netlink')
-rw-r--r-- | net/netlink/genetlink.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 43e72419c86..f329b72578f 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -13,26 +13,27 @@ | |||
13 | #include <linux/socket.h> | 13 | #include <linux/socket.h> |
14 | #include <linux/string.h> | 14 | #include <linux/string.h> |
15 | #include <linux/skbuff.h> | 15 | #include <linux/skbuff.h> |
16 | #include <linux/mutex.h> | ||
16 | #include <net/sock.h> | 17 | #include <net/sock.h> |
17 | #include <net/genetlink.h> | 18 | #include <net/genetlink.h> |
18 | 19 | ||
19 | struct sock *genl_sock = NULL; | 20 | struct sock *genl_sock = NULL; |
20 | 21 | ||
21 | static DECLARE_MUTEX(genl_sem); /* serialization of message processing */ | 22 | static DEFINE_MUTEX(genl_mutex); /* serialization of message processing */ |
22 | 23 | ||
23 | static void genl_lock(void) | 24 | static void genl_lock(void) |
24 | { | 25 | { |
25 | down(&genl_sem); | 26 | mutex_lock(&genl_mutex); |
26 | } | 27 | } |
27 | 28 | ||
28 | static int genl_trylock(void) | 29 | static int genl_trylock(void) |
29 | { | 30 | { |
30 | return down_trylock(&genl_sem); | 31 | return !mutex_trylock(&genl_mutex); |
31 | } | 32 | } |
32 | 33 | ||
33 | static void genl_unlock(void) | 34 | static void genl_unlock(void) |
34 | { | 35 | { |
35 | up(&genl_sem); | 36 | mutex_unlock(&genl_mutex); |
36 | 37 | ||
37 | if (genl_sock && genl_sock->sk_receive_queue.qlen) | 38 | if (genl_sock && genl_sock->sk_receive_queue.qlen) |
38 | genl_sock->sk_data_ready(genl_sock, 0); | 39 | genl_sock->sk_data_ready(genl_sock, 0); |