diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-03-26 01:37:12 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-26 08:56:55 -0800 |
commit | 353ab6e97b8f209dbecc9f650f1f84e3da2a7bb1 (patch) | |
tree | bffabd9a5a493ffd2b41dd825e71e848ca6ba6d7 /fs/partitions | |
parent | e655a250d5fc12b6dfe0d436180ba4a3bfffdc9f (diff) | |
download | linux-3.10-353ab6e97b8f209dbecc9f650f1f84e3da2a7bb1.tar.gz linux-3.10-353ab6e97b8f209dbecc9f650f1f84e3da2a7bb1.tar.bz2 linux-3.10-353ab6e97b8f209dbecc9f650f1f84e3da2a7bb1.zip |
[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 <mingo@elte.hu>
Cc: Eric Van Hensbergen <ericvh@ericvh.myip.org>
Cc: Robert Love <rml@tech9.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Dave Kleikamp <shaggy@austin.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/partitions')
-rw-r--r-- | fs/partitions/devfs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/partitions/devfs.c b/fs/partitions/devfs.c index 87f50444fd3..3f0a780c9ce 100644 --- a/fs/partitions/devfs.c +++ b/fs/partitions/devfs.c @@ -6,7 +6,7 @@ #include <linux/vmalloc.h> #include <linux/genhd.h> #include <linux/bitops.h> -#include <asm/semaphore.h> +#include <linux/mutex.h> 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); } } |