Skip to content

Commit cf0acdc

Browse files
Joel BeckerMark Fasheh
authored andcommitted
ocfs2: Abstract out a debugging function for underlying dlms.
dlmglue.c was still referencing a raw o2dlm lksb in one instance. Let's create a generic ocfs2_dlm_dump_lksb() function. This allows underlying DLMs to print whatever they want about their lock. We then move the o2dlm dump into stackglue.c where it belongs. Signed-off-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Mark Fasheh <mfasheh@suse.com>
1 parent 1693a5c commit cf0acdc

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎fs/ocfs2/dlmglue.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2803,8 +2803,7 @@ static int ocfs2_drop_lock(struct ocfs2_super *osb,
28032803
if (ret) {
28042804
ocfs2_log_dlm_error("ocfs2_dlm_unlock", ret, lockres);
28052805
mlog(ML_ERROR, "lockres flags: %lu\n", lockres->l_flags);
2806-
/* XXX Need to abstract this */
2807-
dlm_print_one_lock(lockres->l_lksb.lksb_o2dlm.lockid);
2806+
ocfs2_dlm_dump_lksb(&lockres->l_lksb);
28082807
BUG();
28092808
}
28102809
mlog(0, "lock %s, successfull return from ocfs2_dlm_unlock\n",

‎fs/ocfs2/stackglue.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ void *ocfs2_dlm_lvb(union ocfs2_dlm_lksb *lksb)
252252
return (void *)(lksb->lksb_o2dlm.lvb);
253253
}
254254

255+
void ocfs2_dlm_dump_lksb(union ocfs2_dlm_lksb *lksb)
256+
{
257+
dlm_print_one_lock(lksb->lksb_o2dlm.lockid);
258+
}
259+
255260
/*
256261
* Called from the dlm when it's about to evict a node. This is how the
257262
* classic stack signals node death.

‎fs/ocfs2/stackglue.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ int ocfs2_dlm_unlock(struct ocfs2_cluster_connection *conn,
9191

9292
int ocfs2_dlm_lock_status(union ocfs2_dlm_lksb *lksb);
9393
void *ocfs2_dlm_lvb(union ocfs2_dlm_lksb *lksb);
94+
void ocfs2_dlm_dump_lksb(union ocfs2_dlm_lksb *lksb);
9495

9596
void o2cb_get_stack(struct ocfs2_locking_protocol *proto);
9697
void o2cb_put_stack(void);

0 commit comments

Comments
 (0)