diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-27 04:18:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:45:03 -0500 |
commit | 48c9c27b8bcd2a328a06151e2d5c1170db0b701b (patch) | |
tree | 804fb1c410e0a246c92105710f1cd22a9daa8edc /drivers/md/dm-table.c | |
parent | 2f889129de148b0ba2e1fbc9e9d33a4ef4c5f2cb (diff) |
[PATCH] sem2mutex: drivers/md
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r-- | drivers/md/dm-table.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c index 76610a6ac01c..8f56a54cf0ce 100644 --- a/drivers/md/dm-table.c +++ b/drivers/md/dm-table.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/ctype.h> | 14 | #include <linux/ctype.h> |
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <linux/interrupt.h> | 16 | #include <linux/interrupt.h> |
17 | #include <linux/mutex.h> | ||
17 | #include <asm/atomic.h> | 18 | #include <asm/atomic.h> |
18 | 19 | ||
19 | #define MAX_DEPTH 16 | 20 | #define MAX_DEPTH 16 |
@@ -770,14 +771,14 @@ int dm_table_complete(struct dm_table *t) | |||
770 | return r; | 771 | return r; |
771 | } | 772 | } |
772 | 773 | ||
773 | static DECLARE_MUTEX(_event_lock); | 774 | static DEFINE_MUTEX(_event_lock); |
774 | void dm_table_event_callback(struct dm_table *t, | 775 | void dm_table_event_callback(struct dm_table *t, |
775 | void (*fn)(void *), void *context) | 776 | void (*fn)(void *), void *context) |
776 | { | 777 | { |
777 | down(&_event_lock); | 778 | mutex_lock(&_event_lock); |
778 | t->event_fn = fn; | 779 | t->event_fn = fn; |
779 | t->event_context = context; | 780 | t->event_context = context; |
780 | up(&_event_lock); | 781 | mutex_unlock(&_event_lock); |
781 | } | 782 | } |
782 | 783 | ||
783 | void dm_table_event(struct dm_table *t) | 784 | void dm_table_event(struct dm_table *t) |
@@ -788,10 +789,10 @@ void dm_table_event(struct dm_table *t) | |||
788 | */ | 789 | */ |
789 | BUG_ON(in_interrupt()); | 790 | BUG_ON(in_interrupt()); |
790 | 791 | ||
791 | down(&_event_lock); | 792 | mutex_lock(&_event_lock); |
792 | if (t->event_fn) | 793 | if (t->event_fn) |
793 | t->event_fn(t->event_context); | 794 | t->event_fn(t->event_context); |
794 | up(&_event_lock); | 795 | mutex_unlock(&_event_lock); |
795 | } | 796 | } |
796 | 797 | ||
797 | sector_t dm_table_get_size(struct dm_table *t) | 798 | sector_t dm_table_get_size(struct dm_table *t) |