[Ocfs2-commits] mfasheh commits r2160 - trunk/fs/ocfs2/dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Apr 21 18:34:47 CDT 2005


Author: mfasheh
Signed-off-by: manish
Date: 2005-04-21 18:34:46 -0500 (Thu, 21 Apr 2005)
New Revision: 2160

Modified:
   trunk/fs/ocfs2/dlm/userdlm.c
Log:
* fix some of the dlmfs cleanup code to be nicer to busy locks

Signed-off-by: manish



Modified: trunk/fs/ocfs2/dlm/userdlm.c
===================================================================
--- trunk/fs/ocfs2/dlm/userdlm.c	2005-04-21 05:36:39 UTC (rev 2159)
+++ trunk/fs/ocfs2/dlm/userdlm.c	2005-04-21 23:34:46 UTC (rev 2160)
@@ -59,17 +59,15 @@
 static inline void user_wait_on_busy_lock(struct user_lock_res *lockres)
 
 {
-	wait_event_interruptible(lockres->l_event,
-				 !user_check_wait_flag(lockres,
-							USER_LOCK_BUSY));
+	wait_event(lockres->l_event,
+		   !user_check_wait_flag(lockres, USER_LOCK_BUSY));
 }
 
 static inline void user_wait_on_blocked_lock(struct user_lock_res *lockres)
 
 {
-	wait_event_interruptible(lockres->l_event,
-				 !user_check_wait_flag(lockres,
-							USER_LOCK_BLOCKED));
+	wait_event(lockres->l_event,
+		   !user_check_wait_flag(lockres, USER_LOCK_BLOCKED));
 }
 
 /* I heart container_of... */
@@ -574,11 +572,14 @@
 	dprintk("asked to destroy %s\n", lockres->l_name);
 
 	spin_lock(&lockres->l_lock);
+	while (lockres->l_flags & USER_LOCK_BUSY) {
+		spin_unlock(&lockres->l_lock);
 
-	if (lockres->l_flags & USER_LOCK_BUSY) {
-		spin_unlock(&lockres->l_lock);
 		dprintk("lock %s is busy\n", lockres->l_name);
-		goto bail;
+
+		user_wait_on_busy_lock(lockres);
+
+		spin_lock(&lockres->l_lock);
 	}
 
 	if (lockres->l_ro_holders || lockres->l_ex_holders) {



More information about the Ocfs2-commits mailing list