aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/locking.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/locking.c')
-rw-r--r--litmus/locking.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/litmus/locking.c b/litmus/locking.c
index 0c1aa6aa40b7..4881ca119acf 100644
--- a/litmus/locking.c
+++ b/litmus/locking.c
@@ -1,3 +1,5 @@
1#include <linux/sched.h>
2#include <litmus/litmus.h>
1#include <litmus/fdso.h> 3#include <litmus/fdso.h>
2 4
3#ifdef CONFIG_LITMUS_LOCKING 5#ifdef CONFIG_LITMUS_LOCKING
@@ -28,14 +30,18 @@ static inline struct litmus_lock* get_lock(struct od_table_entry* entry)
28 return (struct litmus_lock*) entry->obj->obj; 30 return (struct litmus_lock*) entry->obj->obj;
29} 31}
30 32
33atomic_t lock_id = ATOMIC_INIT(0);
34
31static int create_generic_lock(void** obj_ref, obj_type_t type, void* __user arg) 35static int create_generic_lock(void** obj_ref, obj_type_t type, void* __user arg)
32{ 36{
33 struct litmus_lock* lock; 37 struct litmus_lock* lock;
34 int err; 38 int err;
35 39
36 err = litmus->allocate_lock(&lock, type, arg); 40 err = litmus->allocate_lock(&lock, type, arg);
37 if (err == 0) 41 if (err == 0) {
42 lock->id = atomic_add_return(1, &lock_id);
38 *obj_ref = lock; 43 *obj_ref = lock;
44 }
39 return err; 45 return err;
40} 46}
41 47