aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/dm-table.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/dm-table.c')
-rw-r--r--drivers/md/dm-table.c11
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
773static DECLARE_MUTEX(_event_lock); 774static DEFINE_MUTEX(_event_lock);
774void dm_table_event_callback(struct dm_table *t, 775void 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
783void dm_table_event(struct dm_table *t) 784void 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
797sector_t dm_table_get_size(struct dm_table *t) 798sector_t dm_table_get_size(struct dm_table *t)