diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-09-08 10:17:58 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-09-08 10:17:58 -0400 |
commit | 9b47c11d1cbedcba685c9bd90c73fd41acdfab0e (patch) | |
tree | 799f05877bd8973262da54852b7b8bf9a9916998 /fs/gfs2/locking | |
parent | a2c4580797f62b0dd9a48f1e0ce3fe8b8fd76262 (diff) |
[GFS2] Use void * instead of typedef for locking module interface
As requested by Jan Engelhardt, this removes the typedefs in the
locking module interface and replaces them with void *. Also
since we are changing the interface, I've added a few consts
as well.
Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>
Cc: David Teigland <teigland@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/locking')
-rw-r--r-- | fs/gfs2/locking/dlm/lock.c | 32 | ||||
-rw-r--r-- | fs/gfs2/locking/dlm/lock_dlm.h | 22 | ||||
-rw-r--r-- | fs/gfs2/locking/dlm/mount.c | 24 | ||||
-rw-r--r-- | fs/gfs2/locking/dlm/plock.c | 15 | ||||
-rw-r--r-- | fs/gfs2/locking/nolock/main.c | 44 |
5 files changed, 68 insertions, 69 deletions
diff --git a/fs/gfs2/locking/dlm/lock.c b/fs/gfs2/locking/dlm/lock.c index e4359b1b7174..b167addf9fd1 100644 --- a/fs/gfs2/locking/dlm/lock.c +++ b/fs/gfs2/locking/dlm/lock.c | |||
@@ -207,21 +207,21 @@ void gdlm_delete_lp(struct gdlm_lock *lp) | |||
207 | kfree(lp); | 207 | kfree(lp); |
208 | } | 208 | } |
209 | 209 | ||
210 | int gdlm_get_lock(lm_lockspace_t *lockspace, struct lm_lockname *name, | 210 | int gdlm_get_lock(void *lockspace, struct lm_lockname *name, |
211 | lm_lock_t **lockp) | 211 | void **lockp) |
212 | { | 212 | { |
213 | struct gdlm_lock *lp; | 213 | struct gdlm_lock *lp; |
214 | int error; | 214 | int error; |
215 | 215 | ||
216 | error = gdlm_create_lp((struct gdlm_ls *) lockspace, name, &lp); | 216 | error = gdlm_create_lp(lockspace, name, &lp); |
217 | 217 | ||
218 | *lockp = (lm_lock_t *) lp; | 218 | *lockp = lp; |
219 | return error; | 219 | return error; |
220 | } | 220 | } |
221 | 221 | ||
222 | void gdlm_put_lock(lm_lock_t *lock) | 222 | void gdlm_put_lock(void *lock) |
223 | { | 223 | { |
224 | gdlm_delete_lp((struct gdlm_lock *) lock); | 224 | gdlm_delete_lp(lock); |
225 | } | 225 | } |
226 | 226 | ||
227 | unsigned int gdlm_do_lock(struct gdlm_lock *lp) | 227 | unsigned int gdlm_do_lock(struct gdlm_lock *lp) |
@@ -305,10 +305,10 @@ static unsigned int gdlm_do_unlock(struct gdlm_lock *lp) | |||
305 | return LM_OUT_ASYNC; | 305 | return LM_OUT_ASYNC; |
306 | } | 306 | } |
307 | 307 | ||
308 | unsigned int gdlm_lock(lm_lock_t *lock, unsigned int cur_state, | 308 | unsigned int gdlm_lock(void *lock, unsigned int cur_state, |
309 | unsigned int req_state, unsigned int flags) | 309 | unsigned int req_state, unsigned int flags) |
310 | { | 310 | { |
311 | struct gdlm_lock *lp = (struct gdlm_lock *) lock; | 311 | struct gdlm_lock *lp = lock; |
312 | 312 | ||
313 | clear_bit(LFL_DLM_CANCEL, &lp->flags); | 313 | clear_bit(LFL_DLM_CANCEL, &lp->flags); |
314 | if (flags & LM_FLAG_NOEXP) | 314 | if (flags & LM_FLAG_NOEXP) |
@@ -321,9 +321,9 @@ unsigned int gdlm_lock(lm_lock_t *lock, unsigned int cur_state, | |||
321 | return gdlm_do_lock(lp); | 321 | return gdlm_do_lock(lp); |
322 | } | 322 | } |
323 | 323 | ||
324 | unsigned int gdlm_unlock(lm_lock_t *lock, unsigned int cur_state) | 324 | unsigned int gdlm_unlock(void *lock, unsigned int cur_state) |
325 | { | 325 | { |
326 | struct gdlm_lock *lp = (struct gdlm_lock *) lock; | 326 | struct gdlm_lock *lp = lock; |
327 | 327 | ||
328 | clear_bit(LFL_DLM_CANCEL, &lp->flags); | 328 | clear_bit(LFL_DLM_CANCEL, &lp->flags); |
329 | if (lp->cur == DLM_LOCK_IV) | 329 | if (lp->cur == DLM_LOCK_IV) |
@@ -331,9 +331,9 @@ unsigned int gdlm_unlock(lm_lock_t *lock, unsigned int cur_state) | |||
331 | return gdlm_do_unlock(lp); | 331 | return gdlm_do_unlock(lp); |
332 | } | 332 | } |
333 | 333 | ||
334 | void gdlm_cancel(lm_lock_t *lock) | 334 | void gdlm_cancel(void *lock) |
335 | { | 335 | { |
336 | struct gdlm_lock *lp = (struct gdlm_lock *) lock; | 336 | struct gdlm_lock *lp = lock; |
337 | struct gdlm_ls *ls = lp->ls; | 337 | struct gdlm_ls *ls = lp->ls; |
338 | int error, delay_list = 0; | 338 | int error, delay_list = 0; |
339 | 339 | ||
@@ -464,9 +464,9 @@ static void unhold_null_lock(struct gdlm_lock *lp) | |||
464 | intact on the resource while the lvb is "held" even if it's holding no locks | 464 | intact on the resource while the lvb is "held" even if it's holding no locks |
465 | on the resource. */ | 465 | on the resource. */ |
466 | 466 | ||
467 | int gdlm_hold_lvb(lm_lock_t *lock, char **lvbp) | 467 | int gdlm_hold_lvb(void *lock, char **lvbp) |
468 | { | 468 | { |
469 | struct gdlm_lock *lp = (struct gdlm_lock *) lock; | 469 | struct gdlm_lock *lp = lock; |
470 | int error; | 470 | int error; |
471 | 471 | ||
472 | error = gdlm_add_lvb(lp); | 472 | error = gdlm_add_lvb(lp); |
@@ -482,9 +482,9 @@ int gdlm_hold_lvb(lm_lock_t *lock, char **lvbp) | |||
482 | return error; | 482 | return error; |
483 | } | 483 | } |
484 | 484 | ||
485 | void gdlm_unhold_lvb(lm_lock_t *lock, char *lvb) | 485 | void gdlm_unhold_lvb(void *lock, char *lvb) |
486 | { | 486 | { |
487 | struct gdlm_lock *lp = (struct gdlm_lock *) lock; | 487 | struct gdlm_lock *lp = lock; |
488 | 488 | ||
489 | unhold_null_lock(lp); | 489 | unhold_null_lock(lp); |
490 | gdlm_del_lvb(lp); | 490 | gdlm_del_lvb(lp); |
diff --git a/fs/gfs2/locking/dlm/lock_dlm.h b/fs/gfs2/locking/dlm/lock_dlm.h index a4f534a0ecff..3a45c020d01e 100644 --- a/fs/gfs2/locking/dlm/lock_dlm.h +++ b/fs/gfs2/locking/dlm/lock_dlm.h | |||
@@ -112,7 +112,7 @@ struct gdlm_lock { | |||
112 | s16 cur; | 112 | s16 cur; |
113 | s16 req; | 113 | s16 req; |
114 | s16 prev_req; | 114 | s16 prev_req; |
115 | u32 lkf; /* dlm flags DLM_LKF_ */ | 115 | u32 lkf; /* dlm flags DLM_LKF_ */ |
116 | unsigned long flags; /* lock_dlm flags LFL_ */ | 116 | unsigned long flags; /* lock_dlm flags LFL_ */ |
117 | 117 | ||
118 | int bast_mode; /* protected by async_lock */ | 118 | int bast_mode; /* protected by async_lock */ |
@@ -165,23 +165,23 @@ int gdlm_release_all_locks(struct gdlm_ls *); | |||
165 | void gdlm_delete_lp(struct gdlm_lock *); | 165 | void gdlm_delete_lp(struct gdlm_lock *); |
166 | unsigned int gdlm_do_lock(struct gdlm_lock *); | 166 | unsigned int gdlm_do_lock(struct gdlm_lock *); |
167 | 167 | ||
168 | int gdlm_get_lock(lm_lockspace_t *, struct lm_lockname *, lm_lock_t **); | 168 | int gdlm_get_lock(void *, struct lm_lockname *, void **); |
169 | void gdlm_put_lock(lm_lock_t *); | 169 | void gdlm_put_lock(void *); |
170 | unsigned int gdlm_lock(lm_lock_t *, unsigned int, unsigned int, unsigned int); | 170 | unsigned int gdlm_lock(void *, unsigned int, unsigned int, unsigned int); |
171 | unsigned int gdlm_unlock(lm_lock_t *, unsigned int); | 171 | unsigned int gdlm_unlock(void *, unsigned int); |
172 | void gdlm_cancel(lm_lock_t *); | 172 | void gdlm_cancel(void *); |
173 | int gdlm_hold_lvb(lm_lock_t *, char **); | 173 | int gdlm_hold_lvb(void *, char **); |
174 | void gdlm_unhold_lvb(lm_lock_t *, char *); | 174 | void gdlm_unhold_lvb(void *, char *); |
175 | 175 | ||
176 | /* plock.c */ | 176 | /* plock.c */ |
177 | 177 | ||
178 | int gdlm_plock_init(void); | 178 | int gdlm_plock_init(void); |
179 | void gdlm_plock_exit(void); | 179 | void gdlm_plock_exit(void); |
180 | int gdlm_plock(lm_lockspace_t *, struct lm_lockname *, struct file *, int, | 180 | int gdlm_plock(void *, struct lm_lockname *, struct file *, int, |
181 | struct file_lock *); | 181 | struct file_lock *); |
182 | int gdlm_plock_get(lm_lockspace_t *, struct lm_lockname *, struct file *, | 182 | int gdlm_plock_get(void *, struct lm_lockname *, struct file *, |
183 | struct file_lock *); | 183 | struct file_lock *); |
184 | int gdlm_punlock(lm_lockspace_t *, struct lm_lockname *, struct file *, | 184 | int gdlm_punlock(void *, struct lm_lockname *, struct file *, |
185 | struct file_lock *); | 185 | struct file_lock *); |
186 | #endif | 186 | #endif |
187 | 187 | ||
diff --git a/fs/gfs2/locking/dlm/mount.c b/fs/gfs2/locking/dlm/mount.c index 832fb819a2b5..1f94dd35a943 100644 --- a/fs/gfs2/locking/dlm/mount.c +++ b/fs/gfs2/locking/dlm/mount.c | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | int gdlm_drop_count; | 12 | int gdlm_drop_count; |
13 | int gdlm_drop_period; | 13 | int gdlm_drop_period; |
14 | struct lm_lockops gdlm_ops; | 14 | const struct lm_lockops gdlm_ops; |
15 | 15 | ||
16 | 16 | ||
17 | static struct gdlm_ls *init_gdlm(lm_callback_t cb, struct gfs2_sbd *sdp, | 17 | static struct gdlm_ls *init_gdlm(lm_callback_t cb, struct gfs2_sbd *sdp, |
@@ -120,7 +120,7 @@ static int make_args(struct gdlm_ls *ls, char *data_arg, int *nodir) | |||
120 | } | 120 | } |
121 | 121 | ||
122 | static int gdlm_mount(char *table_name, char *host_data, | 122 | static int gdlm_mount(char *table_name, char *host_data, |
123 | lm_callback_t cb, struct gfs2_sbd *sdp, | 123 | lm_callback_t cb, void *cb_data, |
124 | unsigned int min_lvb_size, int flags, | 124 | unsigned int min_lvb_size, int flags, |
125 | struct lm_lockstruct *lockstruct, | 125 | struct lm_lockstruct *lockstruct, |
126 | struct kobject *fskobj) | 126 | struct kobject *fskobj) |
@@ -131,7 +131,7 @@ static int gdlm_mount(char *table_name, char *host_data, | |||
131 | if (min_lvb_size > GDLM_LVB_SIZE) | 131 | if (min_lvb_size > GDLM_LVB_SIZE) |
132 | goto out; | 132 | goto out; |
133 | 133 | ||
134 | ls = init_gdlm(cb, sdp, flags, table_name); | 134 | ls = init_gdlm(cb, cb_data, flags, table_name); |
135 | if (!ls) | 135 | if (!ls) |
136 | goto out; | 136 | goto out; |
137 | 137 | ||
@@ -174,9 +174,9 @@ out: | |||
174 | return error; | 174 | return error; |
175 | } | 175 | } |
176 | 176 | ||
177 | static void gdlm_unmount(lm_lockspace_t *lockspace) | 177 | static void gdlm_unmount(void *lockspace) |
178 | { | 178 | { |
179 | struct gdlm_ls *ls = (struct gdlm_ls *) lockspace; | 179 | struct gdlm_ls *ls = lockspace; |
180 | int rv; | 180 | int rv; |
181 | 181 | ||
182 | log_debug("unmount flags %lx", ls->flags); | 182 | log_debug("unmount flags %lx", ls->flags); |
@@ -198,18 +198,18 @@ out: | |||
198 | kfree(ls); | 198 | kfree(ls); |
199 | } | 199 | } |
200 | 200 | ||
201 | static void gdlm_recovery_done(lm_lockspace_t *lockspace, unsigned int jid, | 201 | static void gdlm_recovery_done(void *lockspace, unsigned int jid, |
202 | unsigned int message) | 202 | unsigned int message) |
203 | { | 203 | { |
204 | struct gdlm_ls *ls = (struct gdlm_ls *) lockspace; | 204 | struct gdlm_ls *ls = lockspace; |
205 | ls->recover_jid_done = jid; | 205 | ls->recover_jid_done = jid; |
206 | ls->recover_jid_status = message; | 206 | ls->recover_jid_status = message; |
207 | kobject_uevent(&ls->kobj, KOBJ_CHANGE); | 207 | kobject_uevent(&ls->kobj, KOBJ_CHANGE); |
208 | } | 208 | } |
209 | 209 | ||
210 | static void gdlm_others_may_mount(lm_lockspace_t *lockspace) | 210 | static void gdlm_others_may_mount(void *lockspace) |
211 | { | 211 | { |
212 | struct gdlm_ls *ls = (struct gdlm_ls *) lockspace; | 212 | struct gdlm_ls *ls = lockspace; |
213 | ls->first_done = 1; | 213 | ls->first_done = 1; |
214 | kobject_uevent(&ls->kobj, KOBJ_CHANGE); | 214 | kobject_uevent(&ls->kobj, KOBJ_CHANGE); |
215 | } | 215 | } |
@@ -218,9 +218,9 @@ static void gdlm_others_may_mount(lm_lockspace_t *lockspace) | |||
218 | other mounters, and lets us know (sets WITHDRAW flag). Then, | 218 | other mounters, and lets us know (sets WITHDRAW flag). Then, |
219 | userspace leaves the mount group while we leave the lockspace. */ | 219 | userspace leaves the mount group while we leave the lockspace. */ |
220 | 220 | ||
221 | static void gdlm_withdraw(lm_lockspace_t *lockspace) | 221 | static void gdlm_withdraw(void *lockspace) |
222 | { | 222 | { |
223 | struct gdlm_ls *ls = (struct gdlm_ls *) lockspace; | 223 | struct gdlm_ls *ls = lockspace; |
224 | 224 | ||
225 | kobject_uevent(&ls->kobj, KOBJ_OFFLINE); | 225 | kobject_uevent(&ls->kobj, KOBJ_OFFLINE); |
226 | 226 | ||
@@ -233,7 +233,7 @@ static void gdlm_withdraw(lm_lockspace_t *lockspace) | |||
233 | gdlm_kobject_release(ls); | 233 | gdlm_kobject_release(ls); |
234 | } | 234 | } |
235 | 235 | ||
236 | struct lm_lockops gdlm_ops = { | 236 | const struct lm_lockops gdlm_ops = { |
237 | .lm_proto_name = "lock_dlm", | 237 | .lm_proto_name = "lock_dlm", |
238 | .lm_mount = gdlm_mount, | 238 | .lm_mount = gdlm_mount, |
239 | .lm_others_may_mount = gdlm_others_may_mount, | 239 | .lm_others_may_mount = gdlm_others_may_mount, |
diff --git a/fs/gfs2/locking/dlm/plock.c b/fs/gfs2/locking/dlm/plock.c index 263636b390fe..7365aec9511b 100644 --- a/fs/gfs2/locking/dlm/plock.c +++ b/fs/gfs2/locking/dlm/plock.c | |||
@@ -58,10 +58,10 @@ static void send_op(struct plock_op *op) | |||
58 | wake_up(&send_wq); | 58 | wake_up(&send_wq); |
59 | } | 59 | } |
60 | 60 | ||
61 | int gdlm_plock(lm_lockspace_t *lockspace, struct lm_lockname *name, | 61 | int gdlm_plock(void *lockspace, struct lm_lockname *name, |
62 | struct file *file, int cmd, struct file_lock *fl) | 62 | struct file *file, int cmd, struct file_lock *fl) |
63 | { | 63 | { |
64 | struct gdlm_ls *ls = (struct gdlm_ls *) lockspace; | 64 | struct gdlm_ls *ls = lockspace; |
65 | struct plock_op *op; | 65 | struct plock_op *op; |
66 | int rv; | 66 | int rv; |
67 | 67 | ||
@@ -102,10 +102,10 @@ int gdlm_plock(lm_lockspace_t *lockspace, struct lm_lockname *name, | |||
102 | return rv; | 102 | return rv; |
103 | } | 103 | } |
104 | 104 | ||
105 | int gdlm_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name, | 105 | int gdlm_punlock(void *lockspace, struct lm_lockname *name, |
106 | struct file *file, struct file_lock *fl) | 106 | struct file *file, struct file_lock *fl) |
107 | { | 107 | { |
108 | struct gdlm_ls *ls = (struct gdlm_ls *) lockspace; | 108 | struct gdlm_ls *ls = lockspace; |
109 | struct plock_op *op; | 109 | struct plock_op *op; |
110 | int rv; | 110 | int rv; |
111 | 111 | ||
@@ -141,10 +141,10 @@ int gdlm_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name, | |||
141 | return rv; | 141 | return rv; |
142 | } | 142 | } |
143 | 143 | ||
144 | int gdlm_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name, | 144 | int gdlm_plock_get(void *lockspace, struct lm_lockname *name, |
145 | struct file *file, struct file_lock *fl) | 145 | struct file *file, struct file_lock *fl) |
146 | { | 146 | { |
147 | struct gdlm_ls *ls = (struct gdlm_ls *) lockspace; | 147 | struct gdlm_ls *ls = lockspace; |
148 | struct plock_op *op; | 148 | struct plock_op *op; |
149 | int rv; | 149 | int rv; |
150 | 150 | ||
@@ -231,8 +231,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count, | |||
231 | 231 | ||
232 | spin_lock(&ops_lock); | 232 | spin_lock(&ops_lock); |
233 | list_for_each_entry(op, &recv_list, list) { | 233 | list_for_each_entry(op, &recv_list, list) { |
234 | if (op->info.fsid == info.fsid && | 234 | if (op->info.fsid == info.fsid && op->info.number == info.number && |
235 | op->info.number == info.number && | ||
236 | op->info.owner == info.owner) { | 235 | op->info.owner == info.owner) { |
237 | list_del_init(&op->list); | 236 | list_del_init(&op->list); |
238 | found = 1; | 237 | found = 1; |
diff --git a/fs/gfs2/locking/nolock/main.c b/fs/gfs2/locking/nolock/main.c index ba7399787f62..7b263fc6c273 100644 --- a/fs/gfs2/locking/nolock/main.c +++ b/fs/gfs2/locking/nolock/main.c | |||
@@ -21,10 +21,10 @@ struct nolock_lockspace { | |||
21 | unsigned int nl_lvb_size; | 21 | unsigned int nl_lvb_size; |
22 | }; | 22 | }; |
23 | 23 | ||
24 | static struct lm_lockops nolock_ops; | 24 | static const struct lm_lockops nolock_ops; |
25 | 25 | ||
26 | static int nolock_mount(char *table_name, char *host_data, | 26 | static int nolock_mount(char *table_name, char *host_data, |
27 | lm_callback_t cb, struct gfs2_sbd *sdp, | 27 | lm_callback_t cb, void *cb_data, |
28 | unsigned int min_lvb_size, int flags, | 28 | unsigned int min_lvb_size, int flags, |
29 | struct lm_lockstruct *lockstruct, | 29 | struct lm_lockstruct *lockstruct, |
30 | struct kobject *fskobj) | 30 | struct kobject *fskobj) |
@@ -50,24 +50,24 @@ static int nolock_mount(char *table_name, char *host_data, | |||
50 | lockstruct->ls_jid = jid; | 50 | lockstruct->ls_jid = jid; |
51 | lockstruct->ls_first = 1; | 51 | lockstruct->ls_first = 1; |
52 | lockstruct->ls_lvb_size = min_lvb_size; | 52 | lockstruct->ls_lvb_size = min_lvb_size; |
53 | lockstruct->ls_lockspace = (lm_lockspace_t *)nl; | 53 | lockstruct->ls_lockspace = nl; |
54 | lockstruct->ls_ops = &nolock_ops; | 54 | lockstruct->ls_ops = &nolock_ops; |
55 | lockstruct->ls_flags = LM_LSFLAG_LOCAL; | 55 | lockstruct->ls_flags = LM_LSFLAG_LOCAL; |
56 | 56 | ||
57 | return 0; | 57 | return 0; |
58 | } | 58 | } |
59 | 59 | ||
60 | static void nolock_others_may_mount(lm_lockspace_t *lockspace) | 60 | static void nolock_others_may_mount(void *lockspace) |
61 | { | 61 | { |
62 | } | 62 | } |
63 | 63 | ||
64 | static void nolock_unmount(lm_lockspace_t *lockspace) | 64 | static void nolock_unmount(void *lockspace) |
65 | { | 65 | { |
66 | struct nolock_lockspace *nl = (struct nolock_lockspace *)lockspace; | 66 | struct nolock_lockspace *nl = lockspace; |
67 | kfree(nl); | 67 | kfree(nl); |
68 | } | 68 | } |
69 | 69 | ||
70 | static void nolock_withdraw(lm_lockspace_t *lockspace) | 70 | static void nolock_withdraw(void *lockspace) |
71 | { | 71 | { |
72 | } | 72 | } |
73 | 73 | ||
@@ -80,10 +80,10 @@ static void nolock_withdraw(lm_lockspace_t *lockspace) | |||
80 | * Returns: 0 on success, -EXXX on failure | 80 | * Returns: 0 on success, -EXXX on failure |
81 | */ | 81 | */ |
82 | 82 | ||
83 | static int nolock_get_lock(lm_lockspace_t *lockspace, struct lm_lockname *name, | 83 | static int nolock_get_lock(void *lockspace, struct lm_lockname *name, |
84 | lm_lock_t **lockp) | 84 | void **lockp) |
85 | { | 85 | { |
86 | *lockp = (lm_lock_t *)lockspace; | 86 | *lockp = lockspace; |
87 | return 0; | 87 | return 0; |
88 | } | 88 | } |
89 | 89 | ||
@@ -93,7 +93,7 @@ static int nolock_get_lock(lm_lockspace_t *lockspace, struct lm_lockname *name, | |||
93 | * | 93 | * |
94 | */ | 94 | */ |
95 | 95 | ||
96 | static void nolock_put_lock(lm_lock_t *lock) | 96 | static void nolock_put_lock(void *lock) |
97 | { | 97 | { |
98 | } | 98 | } |
99 | 99 | ||
@@ -107,7 +107,7 @@ static void nolock_put_lock(lm_lock_t *lock) | |||
107 | * Returns: A bitmap of LM_OUT_* | 107 | * Returns: A bitmap of LM_OUT_* |
108 | */ | 108 | */ |
109 | 109 | ||
110 | static unsigned int nolock_lock(lm_lock_t *lock, unsigned int cur_state, | 110 | static unsigned int nolock_lock(void *lock, unsigned int cur_state, |
111 | unsigned int req_state, unsigned int flags) | 111 | unsigned int req_state, unsigned int flags) |
112 | { | 112 | { |
113 | return req_state | LM_OUT_CACHEABLE; | 113 | return req_state | LM_OUT_CACHEABLE; |
@@ -121,12 +121,12 @@ static unsigned int nolock_lock(lm_lock_t *lock, unsigned int cur_state, | |||
121 | * Returns: 0 | 121 | * Returns: 0 |
122 | */ | 122 | */ |
123 | 123 | ||
124 | static unsigned int nolock_unlock(lm_lock_t *lock, unsigned int cur_state) | 124 | static unsigned int nolock_unlock(void *lock, unsigned int cur_state) |
125 | { | 125 | { |
126 | return 0; | 126 | return 0; |
127 | } | 127 | } |
128 | 128 | ||
129 | static void nolock_cancel(lm_lock_t *lock) | 129 | static void nolock_cancel(void *lock) |
130 | { | 130 | { |
131 | } | 131 | } |
132 | 132 | ||
@@ -138,9 +138,9 @@ static void nolock_cancel(lm_lock_t *lock) | |||
138 | * Returns: 0 on success, -EXXX on failure | 138 | * Returns: 0 on success, -EXXX on failure |
139 | */ | 139 | */ |
140 | 140 | ||
141 | static int nolock_hold_lvb(lm_lock_t *lock, char **lvbp) | 141 | static int nolock_hold_lvb(void *lock, char **lvbp) |
142 | { | 142 | { |
143 | struct nolock_lockspace *nl = (struct nolock_lockspace *)lock; | 143 | struct nolock_lockspace *nl = lock; |
144 | int error = 0; | 144 | int error = 0; |
145 | 145 | ||
146 | *lvbp = kzalloc(nl->nl_lvb_size, GFP_KERNEL); | 146 | *lvbp = kzalloc(nl->nl_lvb_size, GFP_KERNEL); |
@@ -157,12 +157,12 @@ static int nolock_hold_lvb(lm_lock_t *lock, char **lvbp) | |||
157 | * | 157 | * |
158 | */ | 158 | */ |
159 | 159 | ||
160 | static void nolock_unhold_lvb(lm_lock_t *lock, char *lvb) | 160 | static void nolock_unhold_lvb(void *lock, char *lvb) |
161 | { | 161 | { |
162 | kfree(lvb); | 162 | kfree(lvb); |
163 | } | 163 | } |
164 | 164 | ||
165 | static int nolock_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name, | 165 | static int nolock_plock_get(void *lockspace, struct lm_lockname *name, |
166 | struct file *file, struct file_lock *fl) | 166 | struct file *file, struct file_lock *fl) |
167 | { | 167 | { |
168 | struct file_lock tmp; | 168 | struct file_lock tmp; |
@@ -176,7 +176,7 @@ static int nolock_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name, | |||
176 | return 0; | 176 | return 0; |
177 | } | 177 | } |
178 | 178 | ||
179 | static int nolock_plock(lm_lockspace_t *lockspace, struct lm_lockname *name, | 179 | static int nolock_plock(void *lockspace, struct lm_lockname *name, |
180 | struct file *file, int cmd, struct file_lock *fl) | 180 | struct file *file, int cmd, struct file_lock *fl) |
181 | { | 181 | { |
182 | int error; | 182 | int error; |
@@ -184,7 +184,7 @@ static int nolock_plock(lm_lockspace_t *lockspace, struct lm_lockname *name, | |||
184 | return error; | 184 | return error; |
185 | } | 185 | } |
186 | 186 | ||
187 | static int nolock_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name, | 187 | static int nolock_punlock(void *lockspace, struct lm_lockname *name, |
188 | struct file *file, struct file_lock *fl) | 188 | struct file *file, struct file_lock *fl) |
189 | { | 189 | { |
190 | int error; | 190 | int error; |
@@ -192,12 +192,12 @@ static int nolock_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name, | |||
192 | return error; | 192 | return error; |
193 | } | 193 | } |
194 | 194 | ||
195 | static void nolock_recovery_done(lm_lockspace_t *lockspace, unsigned int jid, | 195 | static void nolock_recovery_done(void *lockspace, unsigned int jid, |
196 | unsigned int message) | 196 | unsigned int message) |
197 | { | 197 | { |
198 | } | 198 | } |
199 | 199 | ||
200 | static struct lm_lockops nolock_ops = { | 200 | static const struct lm_lockops nolock_ops = { |
201 | .lm_proto_name = "lock_nolock", | 201 | .lm_proto_name = "lock_nolock", |
202 | .lm_mount = nolock_mount, | 202 | .lm_mount = nolock_mount, |
203 | .lm_others_may_mount = nolock_others_may_mount, | 203 | .lm_others_may_mount = nolock_others_may_mount, |