diff options
author | Joel Becker <joel.becker@oracle.com> | 2008-02-01 12:16:57 -0800 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2008-04-18 08:56:04 -0700 |
commit | 8f2c9c1b16bf6ed0903b29c49d56fa0109a390e4 (patch) | |
tree | 8564370d96cbfb3a0125f17c93ee3587efef1ed1 /fs/ocfs2/stackglue.c | |
parent | 7431cd7e8dd0e46e9b12bd6a1ac1286f4b420371 (diff) | |
download | linux-8f2c9c1b16bf6ed0903b29c49d56fa0109a390e4.tar.bz2 |
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.c | 29 |
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) int ocfs2_dlm_lock(struct dlm_ctxt *dlm, int mode, - struct dlm_lockstatus *lksb, + union ocfs2_dlm_lksb *lksb, u32 flags, void *name, unsigned int namelen, @@ -212,15 +212,16 @@ int ocfs2_dlm_lock(struct dlm_ctxt *dlm, BUG_ON(lproto == NULL); - status = dlmlock(dlm, o2dlm_mode, lksb, o2dlm_flags, name, namelen, - o2dlm_lock_ast_wrapper, astarg, - o2dlm_blocking_ast_wrapper); + status = dlmlock(dlm, o2dlm_mode, &lksb->lksb_o2dlm, o2dlm_flags, + name, namelen, + o2dlm_lock_ast_wrapper, astarg, + o2dlm_blocking_ast_wrapper); ret = dlm_status_to_errno(status); return ret; } int ocfs2_dlm_unlock(struct dlm_ctxt *dlm, - struct dlm_lockstatus *lksb, + union ocfs2_dlm_lksb *lksb, u32 flags, void *astarg) { @@ -230,12 +231,26 @@ int ocfs2_dlm_unlock(struct dlm_ctxt *dlm, BUG_ON(lproto == NULL); - status = dlmunlock(dlm, lksb, o2dlm_flags, - o2dlm_unlock_ast_wrapper, astarg); + status = dlmunlock(dlm, &lksb->lksb_o2dlm, o2dlm_flags, + o2dlm_unlock_ast_wrapper, astarg); ret = dlm_status_to_errno(status); return ret; } +int ocfs2_dlm_lock_status(union ocfs2_dlm_lksb *lksb) +{ + return dlm_status_to_errno(lksb->lksb_o2dlm.status); +} + +/* + * Why don't we cast to ocfs2_meta_lvb? The "clean" answer is that we + * don't cast at the glue level. The real answer is that the header + * ordering is nigh impossible. + */ +void *ocfs2_dlm_lvb(union ocfs2_dlm_lksb *lksb) +{ + return (void *)(lksb->lksb_o2dlm.lvb); +} void o2cb_get_stack(struct ocfs2_locking_protocol *proto) { |