[Ocfs2-commits] khackel commits r1917 - branches/dlm-reco-mig/fs/ocfs2/dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Feb 28 15:53:12 CST 2005


Author: khackel
Date: 2005-02-28 15:53:11 -0600 (Mon, 28 Feb 2005)
New Revision: 1917

Modified:
   branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c
   branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.h
Log:
* introduced __dlm_wait_on_lockres_flags to allow for sleeping on 
  more than one lockres flag
* redefined __dlm_wait_on_lockres as a static inline around this


Modified: branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c
===================================================================
--- branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c	2005-02-28 20:00:15 UTC (rev 1916)
+++ branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.c	2005-02-28 21:53:11 UTC (rev 1917)
@@ -876,14 +876,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: branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.h
===================================================================
--- branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.h	2005-02-28 20:00:15 UTC (rev 1916)
+++ branches/dlm-reco-mig/fs/ocfs2/dlm/dlmmod.h	2005-02-28 21:53:11 UTC (rev 1917)
@@ -659,8 +659,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