aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking/dlm
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/locking/dlm')
-rw-r--r--fs/gfs2/locking/dlm/lock.c32
-rw-r--r--fs/gfs2/locking/dlm/lock_dlm.h22
-rw-r--r--fs/gfs2/locking/dlm/mount.c24
-rw-r--r--fs/gfs2/locking/dlm/plock.c15
4 files changed, 46 insertions, 47 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
210int gdlm_get_lock(lm_lockspace_t *lockspace, struct lm_lockname *name, 210int 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
222void gdlm_put_lock(lm_lock_t *lock) 222void gdlm_put_lock(void *lock)
223{ 223{
224 gdlm_delete_lp((struct gdlm_lock *) lock); 224 gdlm_delete_lp(lock);
225} 225}
226 226
227unsigned int gdlm_do_lock(struct gdlm_lock *lp) 227unsigned 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
308unsigned int gdlm_lock(lm_lock_t *lock, unsigned int cur_state, 308unsigned 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
324unsigned int gdlm_unlock(lm_lock_t *lock, unsigned int cur_state) 324unsigned 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
334void gdlm_cancel(lm_lock_t *lock) 334void 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
467int gdlm_hold_lvb(lm_lock_t *lock, char **lvbp) 467int 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
485void gdlm_unhold_lvb(lm_lock_t *lock, char *lvb) 485void 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 *);
165void gdlm_delete_lp(struct gdlm_lock *); 165void gdlm_delete_lp(struct gdlm_lock *);
166unsigned int gdlm_do_lock(struct gdlm_lock *); 166unsigned int gdlm_do_lock(struct gdlm_lock *);
167 167
168int gdlm_get_lock(lm_lockspace_t *, struct lm_lockname *, lm_lock_t **); 168int gdlm_get_lock(void *, struct lm_lockname *, void **);
169void gdlm_put_lock(lm_lock_t *); 169void gdlm_put_lock(void *);
170unsigned int gdlm_lock(lm_lock_t *, unsigned int, unsigned int, unsigned int); 170unsigned int gdlm_lock(void *, unsigned int, unsigned int, unsigned int);
171unsigned int gdlm_unlock(lm_lock_t *, unsigned int); 171unsigned int gdlm_unlock(void *, unsigned int);
172void gdlm_cancel(lm_lock_t *); 172void gdlm_cancel(void *);
173int gdlm_hold_lvb(lm_lock_t *, char **); 173int gdlm_hold_lvb(void *, char **);
174void gdlm_unhold_lvb(lm_lock_t *, char *); 174void gdlm_unhold_lvb(void *, char *);
175 175
176/* plock.c */ 176/* plock.c */
177 177
178int gdlm_plock_init(void); 178int gdlm_plock_init(void);
179void gdlm_plock_exit(void); 179void gdlm_plock_exit(void);
180int gdlm_plock(lm_lockspace_t *, struct lm_lockname *, struct file *, int, 180int gdlm_plock(void *, struct lm_lockname *, struct file *, int,
181 struct file_lock *); 181 struct file_lock *);
182int gdlm_plock_get(lm_lockspace_t *, struct lm_lockname *, struct file *, 182int gdlm_plock_get(void *, struct lm_lockname *, struct file *,
183 struct file_lock *); 183 struct file_lock *);
184int gdlm_punlock(lm_lockspace_t *, struct lm_lockname *, struct file *, 184int 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
12int gdlm_drop_count; 12int gdlm_drop_count;
13int gdlm_drop_period; 13int gdlm_drop_period;
14struct lm_lockops gdlm_ops; 14const struct lm_lockops gdlm_ops;
15 15
16 16
17static struct gdlm_ls *init_gdlm(lm_callback_t cb, struct gfs2_sbd *sdp, 17static 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
122static int gdlm_mount(char *table_name, char *host_data, 122static 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
177static void gdlm_unmount(lm_lockspace_t *lockspace) 177static 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
201static void gdlm_recovery_done(lm_lockspace_t *lockspace, unsigned int jid, 201static 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
210static void gdlm_others_may_mount(lm_lockspace_t *lockspace) 210static 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
221static void gdlm_withdraw(lm_lockspace_t *lockspace) 221static 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
236struct lm_lockops gdlm_ops = { 236const 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
61int gdlm_plock(lm_lockspace_t *lockspace, struct lm_lockname *name, 61int 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
105int gdlm_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name, 105int 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
144int gdlm_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name, 144int 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;