aboutsummaryrefslogtreecommitdiffstats
path: root/fs/partitions/devfs.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2006-03-26 04:37:12 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-26 11:56:55 -0500
commit353ab6e97b8f209dbecc9f650f1f84e3da2a7bb1 (patch)
treebffabd9a5a493ffd2b41dd825e71e848ca6ba6d7 /fs/partitions/devfs.c
parente655a250d5fc12b6dfe0d436180ba4a3bfffdc9f (diff)
[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/devfs.c')
-rw-r--r--fs/partitions/devfs.c12
1 files changed, 6 insertions, 6 deletions
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 @@
6#include <linux/vmalloc.h> 6#include <linux/vmalloc.h>
7#include <linux/genhd.h> 7#include <linux/genhd.h>
8#include <linux/bitops.h> 8#include <linux/bitops.h>
9#include <asm/semaphore.h> 9#include <linux/mutex.h>
10 10
11 11
12struct unique_numspace { 12struct unique_numspace {
@@ -16,7 +16,7 @@ struct unique_numspace {
16 struct semaphore mutex; 16 struct semaphore mutex;
17}; 17};
18 18
19static DECLARE_MUTEX(numspace_mutex); 19static DEFINE_MUTEX(numspace_mutex);
20 20
21static int expand_numspace(struct unique_numspace *s) 21static int expand_numspace(struct unique_numspace *s)
22{ 22{
@@ -48,7 +48,7 @@ static int alloc_unique_number(struct unique_numspace *s)
48{ 48{
49 int rval = 0; 49 int rval = 0;
50 50
51 down(&numspace_mutex); 51 mutex_lock(&numspace_mutex);
52 if (s->num_free < 1) 52 if (s->num_free < 1)
53 rval = expand_numspace(s); 53 rval = expand_numspace(s);
54 if (!rval) { 54 if (!rval) {
@@ -56,7 +56,7 @@ static int alloc_unique_number(struct unique_numspace *s)
56 --s->num_free; 56 --s->num_free;
57 __set_bit(rval, s->bits); 57 __set_bit(rval, s->bits);
58 } 58 }
59 up(&numspace_mutex); 59 mutex_unlock(&numspace_mutex);
60 60
61 return rval; 61 return rval;
62} 62}
@@ -66,11 +66,11 @@ static void dealloc_unique_number(struct unique_numspace *s, int number)
66 int old_val; 66 int old_val;
67 67
68 if (number >= 0) { 68 if (number >= 0) {
69 down(&numspace_mutex); 69 mutex_lock(&numspace_mutex);
70 old_val = __test_and_clear_bit(number, s->bits); 70 old_val = __test_and_clear_bit(number, s->bits);
71 if (old_val) 71 if (old_val)
72 ++s->num_free; 72 ++s->num_free;
73 up(&numspace_mutex); 73 mutex_unlock(&numspace_mutex);
74 } 74 }
75} 75}
76 76