[Ocfs2-commits] mfasheh commits r2487 - trunk/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Mon Aug 1 16:39:42 CDT 2005
Author: mfasheh
Date: 2005-08-01 16:39:40 -0500 (Mon, 01 Aug 2005)
New Revision: 2487
Modified:
trunk/fs/ocfs2/dlmglue.c
Log:
* the generic_bast function was clearing OCFS2_LOCK_NEEDS_REFRESH when it is
actually the generic_ast function which we want clearing that.
* after fixing the above, ocfs2_inode_bast_func can trivially call into
ocfs2_generic_bast_func so have it do so.
Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c 2005-08-01 21:02:41 UTC (rev 2486)
+++ trunk/fs/ocfs2/dlmglue.c 2005-08-01 21:39:40 UTC (rev 2487)
@@ -622,12 +622,33 @@
return needs_downconvert;
}
+static void ocfs2_generic_bast_func(ocfs2_super *osb,
+ struct ocfs2_lock_res *lockres,
+ int level)
+{
+ int needs_downconvert;
+
+ mlog_entry_void();
+
+ BUG_ON(level <= LKM_NLMODE);
+
+ spin_lock(&lockres->l_lock);
+ needs_downconvert = ocfs2_generic_handle_bast(lockres, level);
+ if (needs_downconvert)
+ ocfs2_schedule_blocked_lock(osb, lockres);
+ spin_unlock(&lockres->l_lock);
+
+ ocfs2_kick_vote_thread(osb);
+
+ wake_up(&lockres->l_event);
+ mlog_exit_void();
+}
+
static void ocfs2_inode_bast_func(void *opaque, int level)
{
struct ocfs2_lock_res *lockres = opaque;
struct inode *inode;
ocfs2_super *osb;
- int needs_downconvert;
mlog_entry_void();
@@ -641,23 +662,13 @@
lockres->l_level,
(lockres->l_type == OCFS2_LOCK_TYPE_META) ? "Meta" : "Data");
- BUG_ON(level <= LKM_NLMODE);
+ ocfs2_generic_bast_func(osb, lockres, level);
- spin_lock(&lockres->l_lock);
-
- needs_downconvert = ocfs2_generic_handle_bast(lockres, level);
- if (needs_downconvert)
- ocfs2_schedule_blocked_lock(osb, lockres);
-
- spin_unlock(&lockres->l_lock);
-
- ocfs2_kick_vote_thread(osb);
- wake_up(&lockres->l_event);
-
mlog_exit_void();
}
-static void ocfs2_generic_ast_func(struct ocfs2_lock_res *lockres)
+static void ocfs2_generic_ast_func(struct ocfs2_lock_res *lockres,
+ int ignore_refresh)
{
struct dlm_lockstatus *lksb = &lockres->l_lksb;
@@ -684,6 +695,9 @@
BUG();
}
+ if (ignore_refresh)
+ lockres_clear_flags(lockres, OCFS2_LOCK_NEEDS_REFRESH);
+
/* set it to something invalid so if we get called again we
* can catch it. */
lockres->l_action = OCFS2_AST_INVALID;
@@ -692,31 +706,6 @@
wake_up(&lockres->l_event);
}
-static void ocfs2_generic_bast_func(ocfs2_super *osb,
- struct ocfs2_lock_res *lockres,
- int level,
- int ignore_refresh)
-{
- int needs_downconvert;
-
- mlog_entry_void();
-
- spin_lock(&lockres->l_lock);
- needs_downconvert = ocfs2_generic_handle_bast(lockres, level);
- if (needs_downconvert)
- ocfs2_schedule_blocked_lock(osb, lockres);
-
- if (ignore_refresh)
- lockres_clear_flags(lockres, OCFS2_LOCK_NEEDS_REFRESH);
-
- spin_unlock(&lockres->l_lock);
-
- ocfs2_kick_vote_thread(osb);
-
- wake_up(&lockres->l_event);
- mlog_exit_void();
-}
-
static void ocfs2_super_ast_func(void *opaque)
{
struct ocfs2_lock_res *lockres = opaque;
@@ -725,7 +714,7 @@
mlog(0, "Superblock AST fired\n");
BUG_ON(!ocfs2_is_super_lock(lockres));
- ocfs2_generic_ast_func(lockres);
+ ocfs2_generic_ast_func(lockres, 0);
mlog_exit_void();
}
@@ -741,7 +730,7 @@
BUG_ON(!ocfs2_is_super_lock(lockres));
osb = ocfs2_lock_res_super(lockres);
- ocfs2_generic_bast_func(osb, lockres, level, 0);
+ ocfs2_generic_bast_func(osb, lockres, level);
mlog_exit_void();
}
@@ -756,7 +745,7 @@
BUG_ON(!ocfs2_is_rename_lock(lockres));
- ocfs2_generic_ast_func(lockres);
+ ocfs2_generic_ast_func(lockres, 1);
mlog_exit_void();
}
@@ -774,7 +763,7 @@
BUG_ON(!ocfs2_is_rename_lock(lockres));
osb = ocfs2_lock_res_super(lockres);
- ocfs2_generic_bast_func(osb, lockres, level, 1);
+ ocfs2_generic_bast_func(osb, lockres, level);
mlog_exit_void();
}
More information about the Ocfs2-commits
mailing list