diff options
author | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-01-28 13:26:15 -0500 |
---|---|---|
committer | Bjoern B. Brandenburg <bbb@cs.unc.edu> | 2011-02-01 16:30:38 -0500 |
commit | a3db326495d4051bddc657d3b226ad4daa7997c4 (patch) | |
tree | c45f6ba9e7229b4318b2cb1b1de886718067eea8 /include | |
parent | 2dea9d5e7727b8474981557cbf925687b8f33865 (diff) |
Litmus core: add generic locking API
Provide a unified userspace interface for plugin-specific locking
protocols.
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus/fdso.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/litmus/fdso.h b/include/litmus/fdso.h index bfab9fdc756c..25a292d68d96 100644 --- a/include/litmus/fdso.h +++ b/include/litmus/fdso.h | |||
@@ -33,12 +33,13 @@ struct inode_obj_id { | |||
33 | unsigned int id; | 33 | unsigned int id; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct fdso_ops; | ||
36 | 37 | ||
37 | struct od_table_entry { | 38 | struct od_table_entry { |
38 | unsigned int used; | 39 | unsigned int used; |
39 | 40 | ||
40 | struct inode_obj_id* obj; | 41 | struct inode_obj_id* obj; |
41 | void* extra; | 42 | const struct fdso_ops* class; |
42 | }; | 43 | }; |
43 | 44 | ||
44 | struct fdso_ops { | 45 | struct fdso_ops { |
@@ -51,14 +52,14 @@ struct fdso_ops { | |||
51 | /* translate a userspace supplied od into the raw table entry | 52 | /* translate a userspace supplied od into the raw table entry |
52 | * returns NULL if od is invalid | 53 | * returns NULL if od is invalid |
53 | */ | 54 | */ |
54 | struct od_table_entry* __od_lookup(int od); | 55 | struct od_table_entry* get_entry_for_od(int od); |
55 | 56 | ||
56 | /* translate a userspace supplied od into the associated object | 57 | /* translate a userspace supplied od into the associated object |
57 | * returns NULL if od is invalid | 58 | * returns NULL if od is invalid |
58 | */ | 59 | */ |
59 | static inline void* od_lookup(int od, obj_type_t type) | 60 | static inline void* od_lookup(int od, obj_type_t type) |
60 | { | 61 | { |
61 | struct od_table_entry* e = __od_lookup(od); | 62 | struct od_table_entry* e = get_entry_for_od(od); |
62 | return e && e->obj->type == type ? e->obj->obj : NULL; | 63 | return e && e->obj->type == type ? e->obj->obj : NULL; |
63 | } | 64 | } |
64 | 65 | ||