aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/stackglue.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/stackglue.c')
-rw-r--r--fs/ocfs2/stackglue.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/fs/ocfs2/stackglue.c b/fs/ocfs2/stackglue.c
index 0aec2fcf2175..eb88854cb976 100644
--- a/fs/ocfs2/stackglue.c
+++ b/fs/ocfs2/stackglue.c
@@ -199,7 +199,7 @@ static void o2dlm_unlock_ast_wrapper(void *astarg, enum dlm_status status)
199 199
200int ocfs2_dlm_lock(struct dlm_ctxt *dlm, 200int ocfs2_dlm_lock(struct dlm_ctxt *dlm,
201 int mode, 201 int mode,
202 struct dlm_lockstatus *lksb, 202 union ocfs2_dlm_lksb *lksb,
203 u32 flags, 203 u32 flags,
204 void *name, 204 void *name,
205 unsigned int namelen, 205 unsigned int namelen,
@@ -212,15 +212,16 @@ int ocfs2_dlm_lock(struct dlm_ctxt *dlm,
212 212
213 BUG_ON(lproto == NULL); 213 BUG_ON(lproto == NULL);
214 214
215 status = dlmlock(dlm, o2dlm_mode, lksb, o2dlm_flags, name, namelen, 215 status = dlmlock(dlm, o2dlm_mode, &lksb->lksb_o2dlm, o2dlm_flags,
216 o2dlm_lock_ast_wrapper, astarg, 216 name, namelen,
217 o2dlm_blocking_ast_wrapper); 217 o2dlm_lock_ast_wrapper, astarg,
218 o2dlm_blocking_ast_wrapper);
218 ret = dlm_status_to_errno(status); 219 ret = dlm_status_to_errno(status);
219 return ret; 220 return ret;
220} 221}
221 222
222int ocfs2_dlm_unlock(struct dlm_ctxt *dlm, 223int ocfs2_dlm_unlock(struct dlm_ctxt *dlm,
223 struct dlm_lockstatus *lksb, 224 union ocfs2_dlm_lksb *lksb,
224 u32 flags, 225 u32 flags,
225 void *astarg) 226 void *astarg)
226{ 227{
@@ -230,12 +231,26 @@ int ocfs2_dlm_unlock(struct dlm_ctxt *dlm,
230 231
231 BUG_ON(lproto == NULL); 232 BUG_ON(lproto == NULL);
232 233
233 status = dlmunlock(dlm, lksb, o2dlm_flags, 234 status = dlmunlock(dlm, &lksb->lksb_o2dlm, o2dlm_flags,
234 o2dlm_unlock_ast_wrapper, astarg); 235 o2dlm_unlock_ast_wrapper, astarg);
235 ret = dlm_status_to_errno(status); 236 ret = dlm_status_to_errno(status);
236 return ret; 237 return ret;
237} 238}
238 239
240int ocfs2_dlm_lock_status(union ocfs2_dlm_lksb *lksb)
241{
242 return dlm_status_to_errno(lksb->lksb_o2dlm.status);
243}
244
245/*
246 * Why don't we cast to ocfs2_meta_lvb? The "clean" answer is that we
247 * don't cast at the glue level. The real answer is that the header
248 * ordering is nigh impossible.
249 */
250void *ocfs2_dlm_lvb(union ocfs2_dlm_lksb *lksb)
251{
252 return (void *)(lksb->lksb_o2dlm.lvb);
253}
239 254
240void o2cb_get_stack(struct ocfs2_locking_protocol *proto) 255void o2cb_get_stack(struct ocfs2_locking_protocol *proto)
241{ 256{