diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-01-28 11:54:38 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-01 16:30:37 -0500 |
commit | fd8ae31c74975c8499983c9831bff2b136b98434 (patch) | |
tree | 63440821ae1e15e5e097eb79006addfab0200ace | |
parent | a0f243fd1d66c3499f88a690e485e94160ac1a8c (diff) |
fdso: supply object type to constructor and destructor methods
Passing the object type explicitly will enable generic lock constructors.
-rw-r--r-- | include/litmus/fdso.h | 4 | ||||
-rw-r--r-- | litmus/fdso.c | 4 | ||||
-rw-r--r-- | litmus/fmlp.c | 4 | ||||
-rw-r--r-- | litmus/srp.c | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/include/litmus/fdso.h b/include/litmus/fdso.h index 61f1b5baf42c..bfab9fdc756c 100644 --- a/include/litmus/fdso.h +++ b/include/litmus/fdso.h | |||
@@ -42,8 +42,8 @@ struct od_table_entry { | |||
42 | }; | 42 | }; |
43 | 43 | ||
44 | struct fdso_ops { | 44 | struct fdso_ops { |
45 | void* (*create) (void); | 45 | void* (*create)(obj_type_t type); |
46 | void (*destroy)(void*); | 46 | void (*destroy)(obj_type_t type, void*); |
47 | int (*open) (struct od_table_entry*, void* __user); | 47 | int (*open) (struct od_table_entry*, void* __user); |
48 | int (*close) (struct od_table_entry*); | 48 | int (*close) (struct od_table_entry*); |
49 | }; | 49 | }; |
diff --git a/litmus/fdso.c b/litmus/fdso.c index 85be716941d8..3bb331e471df 100644 --- a/litmus/fdso.c +++ b/litmus/fdso.c | |||
@@ -29,14 +29,14 @@ static const struct fdso_ops* fdso_ops[] = { | |||
29 | static void* fdso_create(obj_type_t type) | 29 | static void* fdso_create(obj_type_t type) |
30 | { | 30 | { |
31 | if (fdso_ops[type]->create) | 31 | if (fdso_ops[type]->create) |
32 | return fdso_ops[type]->create(); | 32 | return fdso_ops[type]->create(type); |
33 | else | 33 | else |
34 | return NULL; | 34 | return NULL; |
35 | } | 35 | } |
36 | 36 | ||
37 | static void fdso_destroy(obj_type_t type, void* obj) | 37 | static void fdso_destroy(obj_type_t type, void* obj) |
38 | { | 38 | { |
39 | fdso_ops[type]->destroy(obj); | 39 | fdso_ops[type]->destroy(type, obj); |
40 | } | 40 | } |
41 | 41 | ||
42 | static int fdso_open(struct od_table_entry* entry, void* __user config) | 42 | static int fdso_open(struct od_table_entry* entry, void* __user config) |
diff --git a/litmus/fmlp.c b/litmus/fmlp.c index a9a638576d69..1e4d544a9230 100644 --- a/litmus/fmlp.c +++ b/litmus/fmlp.c | |||
@@ -20,7 +20,7 @@ | |||
20 | 20 | ||
21 | #ifdef CONFIG_FMLP | 21 | #ifdef CONFIG_FMLP |
22 | 22 | ||
23 | static void* create_fmlp_semaphore(void) | 23 | static void* create_fmlp_semaphore(obj_type_t type) |
24 | { | 24 | { |
25 | struct pi_semaphore* sem; | 25 | struct pi_semaphore* sem; |
26 | int i; | 26 | int i; |
@@ -45,7 +45,7 @@ static int open_fmlp_semaphore(struct od_table_entry* entry, void* __user arg) | |||
45 | return 0; | 45 | return 0; |
46 | } | 46 | } |
47 | 47 | ||
48 | static void destroy_fmlp_semaphore(void* sem) | 48 | static void destroy_fmlp_semaphore(obj_type_t type, void* sem) |
49 | { | 49 | { |
50 | /* XXX assert invariants */ | 50 | /* XXX assert invariants */ |
51 | kfree(sem); | 51 | kfree(sem); |
diff --git a/litmus/srp.c b/litmus/srp.c index cb577598ce3e..4601b7dba812 100644 --- a/litmus/srp.c +++ b/litmus/srp.c | |||
@@ -108,7 +108,7 @@ static void srp_add_prio(struct srp* srp, struct srp_priority* prio) | |||
108 | } | 108 | } |
109 | 109 | ||
110 | 110 | ||
111 | static void* create_srp_semaphore(void) | 111 | static void* create_srp_semaphore(obj_type_t type) |
112 | { | 112 | { |
113 | struct srp_semaphore* sem; | 113 | struct srp_semaphore* sem; |
114 | 114 | ||
@@ -152,7 +152,7 @@ static noinline int open_srp_semaphore(struct od_table_entry* entry, void* __use | |||
152 | return ret; | 152 | return ret; |
153 | } | 153 | } |
154 | 154 | ||
155 | static void destroy_srp_semaphore(void* sem) | 155 | static void destroy_srp_semaphore(obj_type_t type, void* sem) |
156 | { | 156 | { |
157 | /* XXX invariants */ | 157 | /* XXX invariants */ |
158 | atomic_dec(&srp_objects_in_use); | 158 | atomic_dec(&srp_objects_in_use); |