From 353ab6e97b8f209dbecc9f650f1f84e3da2a7bb1 Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Sun, 26 Mar 2006 01:37:12 -0800 Subject: [PATCH] sem2mutex: fs/ 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 Cc: Eric Van Hensbergen Cc: Robert Love Cc: Thomas Gleixner Cc: David Woodhouse Cc: Neil Brown Cc: Trond Myklebust Cc: Dave Kleikamp Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- fs/partitions/devfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fs/partitions') diff --git a/fs/partitions/devfs.c b/fs/partitions/devfs.c index 87f50444fd39..3f0a780c9cec 100644 --- a/fs/partitions/devfs.c +++ b/fs/partitions/devfs.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include struct unique_numspace { @@ -16,7 +16,7 @@ struct unique_numspace { struct semaphore mutex; }; -static DECLARE_MUTEX(numspace_mutex); +static DEFINE_MUTEX(numspace_mutex); static int expand_numspace(struct unique_numspace *s) { @@ -48,7 +48,7 @@ static int alloc_unique_number(struct unique_numspace *s) { int rval = 0; - down(&numspace_mutex); + mutex_lock(&numspace_mutex); if (s->num_free < 1) rval = expand_numspace(s); if (!rval) { @@ -56,7 +56,7 @@ static int alloc_unique_number(struct unique_numspace *s) --s->num_free; __set_bit(rval, s->bits); } - up(&numspace_mutex); + mutex_unlock(&numspace_mutex); return rval; } @@ -66,11 +66,11 @@ static void dealloc_unique_number(struct unique_numspace *s, int number) int old_val; if (number >= 0) { - down(&numspace_mutex); + mutex_lock(&numspace_mutex); old_val = __test_and_clear_bit(number, s->bits); if (old_val) ++s->num_free; - up(&numspace_mutex); + mutex_unlock(&numspace_mutex); } } -- cgit v1.2.3