[Ocfs2-commits] khackel commits r1944 - trunk/fs/ocfs2/dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Sun Mar 6 17:39:41 CST 2005


Author: khackel
Signed-off-by: zab
Date: 2005-03-06 17:39:39 -0600 (Sun, 06 Mar 2005)
New Revision: 1944

Modified:
   trunk/fs/ocfs2/dlm/dlmmod.c
   trunk/fs/ocfs2/dlm/dlmmod.h
Log:
* Merged 1917 from dlm-reco-mig branch:
	- [1917] __dlm_wait_on_lockres_flags

Signed-off-by: zab



Modified: trunk/fs/ocfs2/dlm/dlmmod.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmod.c	2005-03-06 23:11:16 UTC (rev 1943)
+++ trunk/fs/ocfs2/dlm/dlmmod.c	2005-03-06 23:39:39 UTC (rev 1944)
@@ -875,14 +875,14 @@
 EXPORT_SYMBOL(dlm_register_domain);
 
 /* will exit holding res->spinlock, but may drop in function */
-void __dlm_wait_on_lockres(dlm_lock_resource *res)
+void __dlm_wait_on_lockres_flags(dlm_lock_resource *res, int flags)
 {
 	DECLARE_WAITQUEUE(wait, current);
 
 	add_wait_queue(&res->wq, &wait);
 repeat:
 	set_current_state(TASK_UNINTERRUPTIBLE);
-	if (res->state & DLM_LOCK_RES_IN_PROGRESS) {
+	if (res->state & flags) {
 		spin_unlock(&res->spinlock);
 		schedule();
 		spin_lock(&res->spinlock);

Modified: trunk/fs/ocfs2/dlm/dlmmod.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmod.h	2005-03-06 23:11:16 UTC (rev 1943)
+++ trunk/fs/ocfs2/dlm/dlmmod.h	2005-03-06 23:39:39 UTC (rev 1944)
@@ -649,8 +649,15 @@
 int dlm_lock_owner_broadcast(dlm_ctxt *dlm, dlm_lock_resource *res);
 int dlm_lock_owner_broadcast(dlm_ctxt *dlm, dlm_lock_resource *res);
 
-void __dlm_wait_on_lockres(dlm_lock_resource *res);
+/* will exit holding res->spinlock, but may drop in function */
+void __dlm_wait_on_lockres_flags(dlm_lock_resource *res, int flags);
 
+/* will exit holding res->spinlock, but may drop in function */
+static inline void __dlm_wait_on_lockres(dlm_lock_resource *res)
+{
+	__dlm_wait_on_lockres_flags(res, DLM_LOCK_RES_IN_PROGRESS);
+}
+
 void dlm_init_lock(dlm_lock *newlock, int type, u8 node, u64 cookie);
 
 



More information about the Ocfs2-commits mailing list