aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/lm_interface.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/lm_interface.h')
-rw-r--r--fs/gfs2/lm_interface.h57
1 files changed, 22 insertions, 35 deletions
diff --git a/fs/gfs2/lm_interface.h b/fs/gfs2/lm_interface.h
index 148136a34625..1418fdc9ac02 100644
--- a/fs/gfs2/lm_interface.h
+++ b/fs/gfs2/lm_interface.h
@@ -10,16 +10,8 @@
10#ifndef __LM_INTERFACE_DOT_H__ 10#ifndef __LM_INTERFACE_DOT_H__
11#define __LM_INTERFACE_DOT_H__ 11#define __LM_INTERFACE_DOT_H__
12 12
13/*
14 * Opaque handles represent the lock module's lockspace structure, the lock
15 * module's lock structures, and GFS's file system (superblock) structure.
16 */
17 13
18typedef void lm_lockspace_t; 14typedef void (*lm_callback_t) (void *ptr, unsigned int type, void *data);
19typedef void lm_lock_t;
20struct gfs2_sbd;
21
22typedef void (*lm_callback_t) (struct gfs2_sbd *sdp, unsigned int type, void *data);
23 15
24/* 16/*
25 * lm_mount() flags 17 * lm_mount() flags
@@ -175,64 +167,60 @@ struct lm_async_cb {
175struct lm_lockstruct; 167struct lm_lockstruct;
176 168
177struct lm_lockops { 169struct lm_lockops {
178 char lm_proto_name[256]; 170 const char *lm_proto_name;
179 171
180 /* 172 /*
181 * Mount/Unmount 173 * Mount/Unmount
182 */ 174 */
183 175
184 int (*lm_mount) (char *table_name, char *host_data, 176 int (*lm_mount) (char *table_name, char *host_data,
185 lm_callback_t cb, struct gfs2_sbd *sdp, 177 lm_callback_t cb, void *cb_data,
186 unsigned int min_lvb_size, int flags, 178 unsigned int min_lvb_size, int flags,
187 struct lm_lockstruct *lockstruct, 179 struct lm_lockstruct *lockstruct,
188 struct kobject *fskobj); 180 struct kobject *fskobj);
189 181
190 void (*lm_others_may_mount) (lm_lockspace_t *lockspace); 182 void (*lm_others_may_mount) (void *lockspace);
191 183
192 void (*lm_unmount) (lm_lockspace_t *lockspace); 184 void (*lm_unmount) (void *lockspace);
193 185
194 void (*lm_withdraw) (lm_lockspace_t *lockspace); 186 void (*lm_withdraw) (void *lockspace);
195 187
196 /* 188 /*
197 * Lock oriented operations 189 * Lock oriented operations
198 */ 190 */
199 191
200 int (*lm_get_lock) (lm_lockspace_t *lockspace, 192 int (*lm_get_lock) (void *lockspace, struct lm_lockname *name, void **lockp);
201 struct lm_lockname *name, lm_lock_t **lockp);
202 193
203 void (*lm_put_lock) (lm_lock_t *lock); 194 void (*lm_put_lock) (void *lock);
204 195
205 unsigned int (*lm_lock) (lm_lock_t *lock, unsigned int cur_state, 196 unsigned int (*lm_lock) (void *lock, unsigned int cur_state,
206 unsigned int req_state, unsigned int flags); 197 unsigned int req_state, unsigned int flags);
207 198
208 unsigned int (*lm_unlock) (lm_lock_t *lock, unsigned int cur_state); 199 unsigned int (*lm_unlock) (void *lock, unsigned int cur_state);
209 200
210 void (*lm_cancel) (lm_lock_t *lock); 201 void (*lm_cancel) (void *lock);
211 202
212 int (*lm_hold_lvb) (lm_lock_t *lock, char **lvbp); 203 int (*lm_hold_lvb) (void *lock, char **lvbp);
213 void (*lm_unhold_lvb) (lm_lock_t *lock, char *lvb); 204 void (*lm_unhold_lvb) (void *lock, char *lvb);
214 205
215 /* 206 /*
216 * Posix Lock oriented operations 207 * Posix Lock oriented operations
217 */ 208 */
218 209
219 int (*lm_plock_get) (lm_lockspace_t *lockspace, 210 int (*lm_plock_get) (void *lockspace, struct lm_lockname *name,
220 struct lm_lockname *name,
221 struct file *file, struct file_lock *fl); 211 struct file *file, struct file_lock *fl);
222 212
223 int (*lm_plock) (lm_lockspace_t *lockspace, 213 int (*lm_plock) (void *lockspace, struct lm_lockname *name,
224 struct lm_lockname *name,
225 struct file *file, int cmd, struct file_lock *fl); 214 struct file *file, int cmd, struct file_lock *fl);
226 215
227 int (*lm_punlock) (lm_lockspace_t *lockspace, 216 int (*lm_punlock) (void *lockspace, struct lm_lockname *name,
228 struct lm_lockname *name,
229 struct file *file, struct file_lock *fl); 217 struct file *file, struct file_lock *fl);
230 218
231 /* 219 /*
232 * Client oriented operations 220 * Client oriented operations
233 */ 221 */
234 222
235 void (*lm_recovery_done) (lm_lockspace_t *lockspace, unsigned int jid, 223 void (*lm_recovery_done) (void *lockspace, unsigned int jid,
236 unsigned int message); 224 unsigned int message);
237 225
238 struct module *lm_owner; 226 struct module *lm_owner;
@@ -253,8 +241,8 @@ struct lm_lockstruct {
253 unsigned int ls_jid; 241 unsigned int ls_jid;
254 unsigned int ls_first; 242 unsigned int ls_first;
255 unsigned int ls_lvb_size; 243 unsigned int ls_lvb_size;
256 lm_lockspace_t *ls_lockspace; 244 void *ls_lockspace;
257 struct lm_lockops *ls_ops; 245 const struct lm_lockops *ls_ops;
258 int ls_flags; 246 int ls_flags;
259}; 247};
260 248
@@ -263,9 +251,8 @@ struct lm_lockstruct {
263 * with these functions. 251 * with these functions.
264 */ 252 */
265 253
266int gfs2_register_lockproto(struct lm_lockops *proto); 254int gfs2_register_lockproto(const struct lm_lockops *proto);
267 255void gfs2_unregister_lockproto(const struct lm_lockops *proto);
268void gfs2_unregister_lockproto(struct lm_lockops *proto);
269 256
270/* 257/*
271 * Lock module top interface. GFS calls these functions when mounting or 258 * Lock module top interface. GFS calls these functions when mounting or
@@ -273,7 +260,7 @@ void gfs2_unregister_lockproto(struct lm_lockops *proto);
273 */ 260 */
274 261
275int gfs2_mount_lockproto(char *proto_name, char *table_name, char *host_data, 262int gfs2_mount_lockproto(char *proto_name, char *table_name, char *host_data,
276 lm_callback_t cb, struct gfs2_sbd *sdp, 263 lm_callback_t cb, void *cb_data,
277 unsigned int min_lvb_size, int flags, 264 unsigned int min_lvb_size, int flags,
278 struct lm_lockstruct *lockstruct, 265 struct lm_lockstruct *lockstruct,
279 struct kobject *fskobj); 266 struct kobject *fskobj);