diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-03-26 04:37:14 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 11:56:55 -0500 |
commit | 14cc3e2b633bb64063698980974df4535368e98f (patch) | |
tree | d542c9db7376de199d640b8e34d5630460b217b5 /net/netlink | |
parent | 353ab6e97b8f209dbecc9f650f1f84e3da2a7bb1 (diff) |
[PATCH] sem2mutex: misc static one-file mutexes
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Jens Axboe <axboe@suse.de>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Acked-by: Alasdair G Kergon <agk@redhat.com>
Cc: Greg KH <greg@kroah.com>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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); |