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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Mar 22 20:07:06 CST 2005


Author: mfasheh
Signed-off-by: zab
Date: 2005-03-22 20:07:04 -0600 (Tue, 22 Mar 2005)
New Revision: 2042

Added:
   trunk/fs/ocfs2/dlm/dlmconvert.h
Modified:
   trunk/fs/ocfs2/dlm/Makefile
   trunk/fs/ocfs2/dlm/dlmcommon.h
   trunk/fs/ocfs2/dlm/dlmconvert.c
   trunk/fs/ocfs2/dlm/dlmlock.c
   trunk/fs/ocfs2/dlm/dlmmaster.c
   trunk/fs/ocfs2/dlm/dlmthread.c
   trunk/fs/ocfs2/dlm/dlmunlock.c
Log:
* unexport some functions which don't need it anymore.

Signed-off-by: zab



Modified: trunk/fs/ocfs2/dlm/Makefile
===================================================================
--- trunk/fs/ocfs2/dlm/Makefile	2005-03-23 01:49:32 UTC (rev 2041)
+++ trunk/fs/ocfs2/dlm/Makefile	2005-03-23 02:07:04 UTC (rev 2042)
@@ -58,6 +58,7 @@
 
 HEADERS = 			\
 	dlmdebug.h		\
+	dlmconvert.h		\
 	dlmdomain.h		\
 	dlmcommon.h		\
 	dlmapi.h		\

Modified: trunk/fs/ocfs2/dlm/dlmcommon.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmcommon.h	2005-03-23 01:49:32 UTC (rev 2041)
+++ trunk/fs/ocfs2/dlm/dlmcommon.h	2005-03-23 02:07:04 UTC (rev 2042)
@@ -773,58 +773,17 @@
 
 int dlm_unlock_lock_handler(net_msg *msg, u32 len, void *data);
 
-
-
-
-
 void dlm_shuffle_lists(dlm_ctxt *dlm, dlm_lock_resource *res);
-void dlm_thread_run_lock_resources(dlm_ctxt *dlm);
 int dlm_launch_thread(dlm_ctxt *dlm);
 void dlm_complete_thread(dlm_ctxt *dlm);
 int dlm_launch_recovery_thread(dlm_ctxt *dlm);
 void dlm_complete_recovery_thread(dlm_ctxt *dlm);
-void dlm_flush_asts(dlm_ctxt *dlm);
-int dlm_flush_lockres_asts(dlm_ctxt *dlm, dlm_lock_resource *res);
-		   
-dlm_status dlmlock_master(dlm_ctxt *dlm, dlm_lock_resource *res, 
-			  dlm_lock *lock, int flags);
-dlm_status dlmlock_remote(dlm_ctxt *dlm, dlm_lock_resource *res, 
-			  dlm_lock *lock, int flags);
 
-dlm_status dlmconvert_master(dlm_ctxt *dlm, dlm_lock_resource *res, 
-			     dlm_lock *lock, int flags, int type);
-dlm_status dlmconvert_remote(dlm_ctxt *dlm, dlm_lock_resource *res, 
-			     dlm_lock *lock, int flags, int type);
-
-dlm_status dlmunlock_common(dlm_ctxt *dlm, dlm_lock_resource *res,
-			    dlm_lock *lock, dlm_lockstatus *lksb,
-			    int flags, int *call_ast, int master_node);
-static inline dlm_status dlmunlock_master(dlm_ctxt *dlm,
-					  dlm_lock_resource *res,
-					  dlm_lock *lock,
-					  dlm_lockstatus *lksb,
-					  int flags,
-					  int *call_ast)
-{
-	return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 1);
-}
-
-static inline dlm_status dlmunlock_remote(dlm_ctxt *dlm,
-					  dlm_lock_resource *res,
-					  dlm_lock *lock,
-					  dlm_lockstatus *lksb,
-					  int flags, int *call_ast)
-{
-	return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 0);
-}
-
 void dlm_get(dlm_ctxt *dlm);
 void dlm_put(dlm_ctxt *dlm);
 dlm_ctxt *dlm_grab(dlm_ctxt *dlm);
 int dlm_domain_fully_joined(dlm_ctxt *dlm);
 
-int __dlm_lockres_unused(dlm_lock_resource *res);
-void __dlm_lockres_calc_usage(dlm_ctxt *dlm, dlm_lock_resource *res);
 void dlm_lockres_calc_usage(dlm_ctxt *dlm,
 			    dlm_lock_resource *res);
 void dlm_purge_lockres(dlm_ctxt *dlm, dlm_lock_resource *lockres);
@@ -848,7 +807,6 @@
 				    unsigned int len);
 
 void dlm_change_lockres_owner(dlm_ctxt *dlm, dlm_lock_resource *res, u8 owner);
-void dlm_set_lockres_owner(dlm_ctxt *dlm, dlm_lock_resource *res, u8 owner);
 dlm_lock_resource * dlm_get_lock_resource(dlm_ctxt *dlm, 
 					  const char *lockid,
 					  int flags);
@@ -856,10 +814,6 @@
 				   const char *name, 
 				   unsigned int namelen);
 
-int dlm_lock_owner_broadcast(dlm_ctxt *dlm, dlm_lock_resource *res);
-int dlm_refresh_lock_resource(dlm_ctxt *dlm, dlm_lock_resource *res);
-
-
 void __dlm_queue_ast(dlm_ctxt *dlm, dlm_lock *lock);
 void dlm_queue_ast(dlm_ctxt *dlm, dlm_lock *lock);
 void __dlm_queue_bast(dlm_ctxt *dlm, dlm_lock *lock);
@@ -897,7 +851,6 @@
 int dlm_migrate_lockres(dlm_ctxt *dlm, dlm_lock_resource *res, u8 target);
 int dlm_finish_migration(dlm_ctxt *dlm, dlm_lock_resource *res, u8 old_master);
 
-int dlm_lock_owner_broadcast(dlm_ctxt *dlm, dlm_lock_resource *res);
 int dlm_master_request_handler(net_msg *msg, u32 len, void *data);
 int dlm_assert_master_handler(net_msg *msg, u32 len, void *data);
 int dlm_migrate_request_handler(net_msg *msg, u32 len, void *data);
@@ -908,7 +861,7 @@
 int dlm_begin_reco_handler(net_msg *msg, u32 len, void *data);
 int dlm_finalize_reco_handler(net_msg *msg, u32 len, void *data);
 
-	
+
 int dlm_send_one_lockres(dlm_ctxt *dlm, dlm_lock_resource *res, 
 			 dlm_migratable_lockres *mres, 
 			 u8 send_to, u8 flags);

Modified: trunk/fs/ocfs2/dlm/dlmconvert.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmconvert.c	2005-03-23 01:49:32 UTC (rev 2041)
+++ trunk/fs/ocfs2/dlm/dlmconvert.c	2005-03-23 02:07:04 UTC (rev 2042)
@@ -47,6 +47,7 @@
 #include "dlmapi.h"
 #include "dlmcommon.h"
 
+#include "dlmconvert.h"
 
 /* NOTE: __dlmconvert_master is the only function in here that
  * needs a spinlock held on entry (res->spinlock) and it is the

Added: trunk/fs/ocfs2/dlm/dlmconvert.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmconvert.h	2005-03-23 01:49:32 UTC (rev 2041)
+++ trunk/fs/ocfs2/dlm/dlmconvert.h	2005-03-23 02:07:04 UTC (rev 2042)
@@ -0,0 +1,33 @@
+/* -*- mode: c; c-basic-offset: 8; -*-
+ * vim: noexpandtab sw=8 ts=8 sts=0:
+ *
+ * dlmconvert.h
+ *
+ * Copyright (C) 2004 Oracle.  All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 021110-1307, USA.
+ *
+ */
+
+#ifndef DLMCONVERT_H
+#define DLMCONVERT_H
+
+dlm_status dlmconvert_master(dlm_ctxt *dlm, dlm_lock_resource *res, 
+			     dlm_lock *lock, int flags, int type);
+dlm_status dlmconvert_remote(dlm_ctxt *dlm, dlm_lock_resource *res, 
+			     dlm_lock *lock, int flags, int type);
+
+#endif

Modified: trunk/fs/ocfs2/dlm/dlmlock.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmlock.c	2005-03-23 01:49:32 UTC (rev 2041)
+++ trunk/fs/ocfs2/dlm/dlmlock.c	2005-03-23 02:07:04 UTC (rev 2042)
@@ -47,6 +47,8 @@
 #include "dlmapi.h"
 #include "dlmcommon.h"
 
+#include "dlmconvert.h"
+
 static spinlock_t dlm_cookie_lock = SPIN_LOCK_UNLOCKED;
 static u64 dlm_next_cookie = 1;
 
@@ -91,8 +93,8 @@
  *   held on exit:  none
  * returns: DLM_NORMAL, DLM_NOTQUEUED
  */
-dlm_status dlmlock_master(dlm_ctxt *dlm, dlm_lock_resource *res, 
-			  dlm_lock *lock, int flags)
+static dlm_status dlmlock_master(dlm_ctxt *dlm, dlm_lock_resource *res, 
+				 dlm_lock *lock, int flags)
 {
 	int call_ast = 0;
 	dlm_status status = DLM_NORMAL;
@@ -151,8 +153,8 @@
  *   held on exit:  none
  * returns: DLM_DENIED, DLM_RECOVERING, or net status
  */
-dlm_status dlmlock_remote(dlm_ctxt *dlm, dlm_lock_resource *res, 
-			  dlm_lock *lock, int flags)
+static dlm_status dlmlock_remote(dlm_ctxt *dlm, dlm_lock_resource *res, 
+				 dlm_lock *lock, int flags)
 {
 	dlm_status status = DLM_DENIED;
 

Modified: trunk/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmaster.c	2005-03-23 01:49:32 UTC (rev 2041)
+++ trunk/fs/ocfs2/dlm/dlmmaster.c	2005-03-23 02:07:04 UTC (rev 2042)
@@ -374,7 +374,9 @@
  * LOCK RESOURCE FUNCTIONS
  */
 
-void dlm_set_lockres_owner(dlm_ctxt *dlm, dlm_lock_resource *res, u8 owner)
+static void dlm_set_lockres_owner(dlm_ctxt *dlm,
+				  dlm_lock_resource *res,
+				  u8 owner)
 {
 	assert_spin_locked(&res->spinlock);
 
@@ -1295,6 +1297,11 @@
 	return 0;
 }
 
+int dlm_flush_lockres_asts(dlm_ctxt *dlm, dlm_lock_resource *res)
+{
+#warning need to implement dlm_flush_lockres_asts
+	return 0;
+}
 
 int dlm_migrate_lockres(dlm_ctxt *dlm, dlm_lock_resource *res, u8 target)
 {
@@ -1539,12 +1546,6 @@
 	}
 }
 
-int dlm_flush_lockres_asts(dlm_ctxt *dlm, dlm_lock_resource *res)
-{
-#warning need to implement dlm_flush_lockres_asts
-	return 0;
-}
-
 /* for now this is not too intelligent.  we will 
  * need stats to make this do the right thing. 
  * this just finds the first lock on one of the

Modified: trunk/fs/ocfs2/dlm/dlmthread.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmthread.c	2005-03-23 01:49:32 UTC (rev 2041)
+++ trunk/fs/ocfs2/dlm/dlmthread.c	2005-03-23 02:07:04 UTC (rev 2042)
@@ -77,7 +77,7 @@
 	current->state = TASK_RUNNING;
 }
 
-int __dlm_lockres_unused(dlm_lock_resource *res)
+static int __dlm_lockres_unused(dlm_lock_resource *res)
 {
 	if (list_empty(&res->granted) &&
 	    list_empty(&res->converting) &&
@@ -91,7 +91,7 @@
 /* Call whenever you may have added or deleted something from one of
  * the lockres queue's. This will figure out whether it belongs on the
  * unused list or not and does the appropriate thing. */
-void __dlm_lockres_calc_usage(dlm_ctxt *dlm, dlm_lock_resource *res)
+static void __dlm_lockres_calc_usage(dlm_ctxt *dlm, dlm_lock_resource *res)
 {
 	dlmprintk0("\n");
 
@@ -424,7 +424,7 @@
 	return empty;
 }
 
-void dlm_flush_asts(dlm_ctxt *dlm)
+static void dlm_flush_asts(dlm_ctxt *dlm)
 {
 	struct list_head *iter, *iter2;
 	dlm_lock *lock;

Modified: trunk/fs/ocfs2/dlm/dlmunlock.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmunlock.c	2005-03-23 01:49:32 UTC (rev 2041)
+++ trunk/fs/ocfs2/dlm/dlmunlock.c	2005-03-23 02:07:04 UTC (rev 2042)
@@ -76,9 +76,9 @@
  *   held on exit:  none
  * returns: DLM_NORMAL, DLM_NOLOCKMGR, status from network
  */
-dlm_status dlmunlock_common(dlm_ctxt *dlm, dlm_lock_resource *res, 
-			    dlm_lock *lock, dlm_lockstatus *lksb, 
-			    int flags, int *call_ast, int master_node)
+static dlm_status dlmunlock_common(dlm_ctxt *dlm, dlm_lock_resource *res, 
+				   dlm_lock *lock, dlm_lockstatus *lksb, 
+				   int flags, int *call_ast, int master_node)
 {
 	dlm_status status;
 	int actions = 0;
@@ -186,6 +186,25 @@
 	return status;
 }
 
+static inline dlm_status dlmunlock_master(dlm_ctxt *dlm,
+					  dlm_lock_resource *res,
+					  dlm_lock *lock,
+					  dlm_lockstatus *lksb,
+					  int flags,
+					  int *call_ast)
+{
+	return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 1);
+}
+
+static inline dlm_status dlmunlock_remote(dlm_ctxt *dlm,
+					  dlm_lock_resource *res,
+					  dlm_lock *lock,
+					  dlm_lockstatus *lksb,
+					  int flags, int *call_ast)
+{
+	return dlmunlock_common(dlm, res, lock, lksb, flags, call_ast, 0);
+}
+
 /* 
  * locking:
  *   caller needs:  none



More information about the Ocfs2-commits mailing list