[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>
This commit is contained in:
Ingo Molnar
2006-03-26 01:37:14 -08:00
committed by Linus Torvalds
parent 353ab6e97b
commit 14cc3e2b63
20 changed files with 172 additions and 157 deletions

View File

@ -13,26 +13,27 @@
#include <linux/socket.h>
#include <linux/string.h>
#include <linux/skbuff.h>
#include <linux/mutex.h>
#include <net/sock.h>
#include <net/genetlink.h>
struct sock *genl_sock = NULL;
static DECLARE_MUTEX(genl_sem); /* serialization of message processing */
static DEFINE_MUTEX(genl_mutex); /* serialization of message processing */
static void genl_lock(void)
{
down(&genl_sem);
mutex_lock(&genl_mutex);
}
static int genl_trylock(void)
{
return down_trylock(&genl_sem);
return !mutex_trylock(&genl_mutex);
}
static void genl_unlock(void)
{
up(&genl_sem);
mutex_unlock(&genl_mutex);
if (genl_sock && genl_sock->sk_receive_queue.qlen)
genl_sock->sk_data_ready(genl_sock, 0);