aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlmglue.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/dlmglue.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/dlmglue.c')
-rw-r--r--fs/ocfs2/dlmglue.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 6a222a5c81da..459037653e5a 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -112,7 +112,8 @@ static void ocfs2_dump_meta_lvb_info(u64 level,
112 unsigned int line, 112 unsigned int line,
113 struct ocfs2_lock_res *lockres) 113 struct ocfs2_lock_res *lockres)
114{ 114{
115 struct ocfs2_meta_lvb *lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb; 115 struct ocfs2_meta_lvb *lvb =
116 (struct ocfs2_meta_lvb *)ocfs2_dlm_lvb(&lockres->l_lksb);
116 117
117 mlog(level, "LVB information for %s (called from %s:%u):\n", 118 mlog(level, "LVB information for %s (called from %s:%u):\n",
118 lockres->l_name, function, line); 119 lockres->l_name, function, line);
@@ -799,14 +800,14 @@ static void ocfs2_blocking_ast(void *opaque, int level)
799static void ocfs2_locking_ast(void *opaque) 800static void ocfs2_locking_ast(void *opaque)
800{ 801{
801 struct ocfs2_lock_res *lockres = opaque; 802 struct ocfs2_lock_res *lockres = opaque;
802 struct dlm_lockstatus *lksb = &lockres->l_lksb;
803 unsigned long flags; 803 unsigned long flags;
804 804
805 spin_lock_irqsave(&lockres->l_lock, flags); 805 spin_lock_irqsave(&lockres->l_lock, flags);
806 806
807 if (lksb->status != DLM_NORMAL) { 807 if (ocfs2_dlm_lock_status(&lockres->l_lksb)) {
808 mlog(ML_ERROR, "lockres %s: lksb status value of %u!\n", 808 mlog(ML_ERROR, "lockres %s: lksb status value of %d!\n",
809 lockres->l_name, lksb->status); 809 lockres->l_name,
810 ocfs2_dlm_lock_status(&lockres->l_lksb));
810 spin_unlock_irqrestore(&lockres->l_lock, flags); 811 spin_unlock_irqrestore(&lockres->l_lock, flags);
811 return; 812 return;
812 } 813 }
@@ -1634,7 +1635,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode)
1634 1635
1635 mlog_entry_void(); 1636 mlog_entry_void();
1636 1637
1637 lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb; 1638 lvb = (struct ocfs2_meta_lvb *)ocfs2_dlm_lvb(&lockres->l_lksb);
1638 1639
1639 /* 1640 /*
1640 * Invalidate the LVB of a deleted inode - this way other 1641 * Invalidate the LVB of a deleted inode - this way other
@@ -1686,7 +1687,7 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode)
1686 1687
1687 mlog_meta_lvb(0, lockres); 1688 mlog_meta_lvb(0, lockres);
1688 1689
1689 lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb; 1690 lvb = (struct ocfs2_meta_lvb *)ocfs2_dlm_lvb(&lockres->l_lksb);
1690 1691
1691 /* We're safe here without the lockres lock... */ 1692 /* We're safe here without the lockres lock... */
1692 spin_lock(&oi->ip_lock); 1693 spin_lock(&oi->ip_lock);
@@ -1721,7 +1722,8 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode)
1721static inline int ocfs2_meta_lvb_is_trustable(struct inode *inode, 1722static inline int ocfs2_meta_lvb_is_trustable(struct inode *inode,
1722 struct ocfs2_lock_res *lockres) 1723 struct ocfs2_lock_res *lockres)
1723{ 1724{
1724 struct ocfs2_meta_lvb *lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb; 1725 struct ocfs2_meta_lvb *lvb =
1726 (struct ocfs2_meta_lvb *)ocfs2_dlm_lvb(&lockres->l_lksb);
1725 1727
1726 if (lvb->lvb_version == OCFS2_LVB_VERSION 1728 if (lvb->lvb_version == OCFS2_LVB_VERSION
1727 && be32_to_cpu(lvb->lvb_igeneration) == inode->i_generation) 1729 && be32_to_cpu(lvb->lvb_igeneration) == inode->i_generation)
@@ -2379,7 +2381,7 @@ static int ocfs2_dlm_seq_show(struct seq_file *m, void *v)
2379 lockres->l_blocking); 2381 lockres->l_blocking);
2380 2382
2381 /* Dump the raw LVB */ 2383 /* Dump the raw LVB */
2382 lvb = lockres->l_lksb.lvb; 2384 lvb = ocfs2_dlm_lvb(&lockres->l_lksb);
2383 for(i = 0; i < DLM_LVB_LEN; i++) 2385 for(i = 0; i < DLM_LVB_LEN; i++)
2384 seq_printf(m, "0x%x\t", lvb[i]); 2386 seq_printf(m, "0x%x\t", lvb[i]);
2385 2387
@@ -2692,7 +2694,8 @@ static int ocfs2_drop_lock(struct ocfs2_super *osb,
2692 if (ret) { 2694 if (ret) {
2693 ocfs2_log_dlm_error("ocfs2_dlm_unlock", ret, lockres); 2695 ocfs2_log_dlm_error("ocfs2_dlm_unlock", ret, lockres);
2694 mlog(ML_ERROR, "lockres flags: %lu\n", lockres->l_flags); 2696 mlog(ML_ERROR, "lockres flags: %lu\n", lockres->l_flags);
2695 dlm_print_one_lock(lockres->l_lksb.lockid); 2697 /* XXX Need to abstract this */
2698 dlm_print_one_lock(lockres->l_lksb.lksb_o2dlm.lockid);
2696 BUG(); 2699 BUG();
2697 } 2700 }
2698 mlog(0, "lock %s, successfull return from ocfs2_dlm_unlock\n", 2701 mlog(0, "lock %s, successfull return from ocfs2_dlm_unlock\n",