aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/stackglue.c
diff options
context:
space:
mode:
authorJoel Becker <joel.becker@oracle.com>2008-02-01 15:16:57 -0500
committerMark Fasheh <mfasheh@suse.com>2008-04-18 11:56:04 -0400
commit8f2c9c1b16bf6ed0903b29c49d56fa0109a390e4 (patch)
tree8564370d96cbfb3a0125f17c93ee3587efef1ed1 /fs/ocfs2/stackglue.c
parent7431cd7e8dd0e46e9b12bd6a1ac1286f4b420371 (diff)
ocfs2: Create the lock status block union.
Wrap the lock status block (lksb) in a union. Later we will add a union element for the fs/dlm lksb. Create accessors for the status and lvb fields. Other than a debugging function, dlmglue.c does not directly reference the o2dlm locking path anymore. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
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{