[Ocfs2-commits] mfasheh commits r2672 - in trunk/fs/ocfs2: . cluster dlm

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Oct 31 14:20:29 CST 2005


Author: mfasheh
Signed-off-by: jlbec
Date: 2005-10-31 14:20:26 -0600 (Mon, 31 Oct 2005)
New Revision: 2672

Modified:
   trunk/fs/ocfs2/alloc.c
   trunk/fs/ocfs2/alloc.h
   trunk/fs/ocfs2/cluster/heartbeat.c
   trunk/fs/ocfs2/cluster/heartbeat.h
   trunk/fs/ocfs2/cluster/sys.c
   trunk/fs/ocfs2/dlm/dlmast.c
   trunk/fs/ocfs2/dlm/dlmcommon.h
   trunk/fs/ocfs2/dlm/dlmdomain.c
   trunk/fs/ocfs2/dlm/dlmdomain.h
   trunk/fs/ocfs2/dlm/dlmlock.c
   trunk/fs/ocfs2/dlm/dlmmaster.c
   trunk/fs/ocfs2/dlm/dlmrecovery.c
   trunk/fs/ocfs2/dlm/dlmthread.c
   trunk/fs/ocfs2/extent_map.c
   trunk/fs/ocfs2/extent_map.h
   trunk/fs/ocfs2/file.c
   trunk/fs/ocfs2/file.h
   trunk/fs/ocfs2/ver.c
   trunk/fs/ocfs2/ver.h
Log:
* Commit a patch by Adrian Bunk <bunk at stusta.de> with minor changes by 
  myself:

From: Adrian Bunk <bunk at stusta.de>                                            
Subject: [-mm patch] fs/ocfs2/: possible cleanups                             
                                                                              
This patch contains the following possible cleanups:                          
- make needlessly global code static                                          
- every function should #include the headers with the prototypes of it's      
  global functions                                                            
- #if 0 unused code

* My changes were to actually remove most of the if 0'd code, and comment   
  the parts which stayed behind.

Signed-off-by: jlbec



Modified: trunk/fs/ocfs2/alloc.c
===================================================================
--- trunk/fs/ocfs2/alloc.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/alloc.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -92,6 +92,8 @@
 				       struct buffer_head *old_last_eb,
 				       struct buffer_head **new_last_eb);
 
+static void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc);
+
 static int ocfs2_extent_contig(struct inode *inode,
 			       ocfs2_extent_rec *ext,
 			       u64 blkno)
@@ -2018,7 +2020,7 @@
 	return status;
 }
 
-void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc)
+static void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc)
 {
 	if (tc->tc_ext_alloc_inode) {
 		if (tc->tc_ext_alloc_locked)

Modified: trunk/fs/ocfs2/alloc.h
===================================================================
--- trunk/fs/ocfs2/alloc.h	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/alloc.h	2005-10-31 20:20:26 UTC (rev 2672)
@@ -70,8 +70,6 @@
 	struct buffer_head *tc_last_eb_bh;
 };
 
-void ocfs2_free_truncate_context(struct ocfs2_truncate_context *tc);
-
 int ocfs2_prepare_truncate(ocfs2_super *osb,
 			   struct inode *inode,
 			   struct buffer_head *fe_bh,

Modified: trunk/fs/ocfs2/cluster/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/cluster/heartbeat.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -969,7 +969,8 @@
 }
 
 /* if we're already in a callback then we're already serialized by the sem */
-void o2hb_fill_node_map_from_callback(unsigned long *map, unsigned bytes)
+static void o2hb_fill_node_map_from_callback(unsigned long *map,
+					     unsigned bytes)
 {
 	BUG_ON(bytes < (BITS_TO_LONGS(O2NM_MAX_NODES) * sizeof(unsigned long)));
 
@@ -1776,23 +1777,6 @@
 }
 EXPORT_SYMBOL_GPL(o2hb_check_local_node_heartbeating);
 
-/* Makes sure our local node is configured with a node number, and is
- * heartbeating. */
-int o2hb_check_local_node_heartbeating_from_callback(void)
-{
-	u8 node_num;
-
-	/* if this node was set then we have networking */
-	node_num = o2nm_this_node();
-	if (node_num == O2NM_MAX_NODES) {
-		mlog(ML_HEARTBEAT, "this node has not been configured.\n");
-		return 0;
-	}
-
-	return o2hb_check_node_heartbeating_from_callback(node_num);
-}
-EXPORT_SYMBOL_GPL(o2hb_check_local_node_heartbeating_from_callback);
-
 /*
  * this is just a hack until we get the plumbing which flips file systems
  * read only and drops the hb ref instead of killing the node dead.

Modified: trunk/fs/ocfs2/cluster/heartbeat.h
===================================================================
--- trunk/fs/ocfs2/cluster/heartbeat.h	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/cluster/heartbeat.h	2005-10-31 20:20:26 UTC (rev 2672)
@@ -73,12 +73,10 @@
 int o2hb_unregister_callback(struct o2hb_callback_func *hc);
 void o2hb_fill_node_map(unsigned long *map,
 			unsigned bytes);
-void o2hb_fill_node_map_from_callback(unsigned long *map, unsigned bytes);
 void o2hb_init(void);
 int o2hb_check_node_heartbeating(u8 node_num);
 int o2hb_check_node_heartbeating_from_callback(u8 node_num);
 int o2hb_check_local_node_heartbeating(void);
-int o2hb_check_local_node_heartbeating_from_callback(void);
 void o2hb_stop_all_regions(void);
 
 #endif /* O2CLUSTER_HEARTBEAT_H */

Modified: trunk/fs/ocfs2/cluster/sys.c
===================================================================
--- trunk/fs/ocfs2/cluster/sys.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/cluster/sys.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -31,6 +31,7 @@
 
 #include "ocfs2_nodemanager.h"
 #include "masklog.h"
+#include "sys.h"
 
 struct o2cb_attribute {
 	struct attribute	attr;
@@ -66,7 +67,7 @@
 	.store	= o2cb_store,
 };
 
-struct kobj_type o2cb_subsys_type = {
+static struct kobj_type o2cb_subsys_type = {
 	.default_attrs	= o2cb_attrs,
 	.sysfs_ops	= &o2cb_sysfs_ops,
 };

Modified: trunk/fs/ocfs2/dlm/dlmast.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmast.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/dlm/dlmast.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -91,7 +91,7 @@
 	return 0;
 }
 
-void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
+static void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
 {
 	mlog_entry_void();
 
@@ -136,7 +136,7 @@
 }
 
 
-void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
+static void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock)
 {
 	mlog_entry_void();
 

Modified: trunk/fs/ocfs2/dlm/dlmcommon.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmcommon.h	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/dlm/dlmcommon.h	2005-10-31 20:20:26 UTC (rev 2672)
@@ -634,7 +634,6 @@
 void dlm_lock_get(struct dlm_lock *lock);
 void dlm_lock_put(struct dlm_lock *lock);
 
-void dlm_lock_detach_lockres(struct dlm_lock *lock);
 void dlm_lock_attach_lockres(struct dlm_lock *lock,
 			     struct dlm_lock_resource *res);
 
@@ -653,17 +652,12 @@
 void dlm_commit_pending_unlock(struct dlm_lock_resource *res,
 			       struct dlm_lock *lock);
 
-void dlm_shuffle_lists(struct dlm_ctxt *dlm,
-		       struct dlm_lock_resource *res);
 int dlm_launch_thread(struct dlm_ctxt *dlm);
 void dlm_complete_thread(struct dlm_ctxt *dlm);
-void dlm_flush_asts(struct dlm_ctxt *dlm);
-int dlm_flush_lockres_asts(struct dlm_ctxt *dlm, struct dlm_lock_resource *res);
 int dlm_launch_recovery_thread(struct dlm_ctxt *dlm);
 void dlm_complete_recovery_thread(struct dlm_ctxt *dlm);
 void dlm_wait_for_recovery(struct dlm_ctxt *dlm);
 
-void dlm_get(struct dlm_ctxt *dlm);
 void dlm_put(struct dlm_ctxt *dlm);
 struct dlm_ctxt *dlm_grab(struct dlm_ctxt *dlm);
 int dlm_domain_fully_joined(struct dlm_ctxt *dlm);
@@ -697,9 +691,7 @@
 					  const char *name,
 					  unsigned int namelen);
 
-void __dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock);
 void dlm_queue_ast(struct dlm_ctxt *dlm, struct dlm_lock *lock);
-void __dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock);
 void dlm_queue_bast(struct dlm_ctxt *dlm, struct dlm_lock *lock);
 void dlm_do_local_ast(struct dlm_ctxt *dlm,
 		      struct dlm_lock_resource *res,
@@ -739,17 +731,13 @@
 
 u8 dlm_nm_this_node(struct dlm_ctxt *dlm);
 void dlm_kick_thread(struct dlm_ctxt *dlm, struct dlm_lock_resource *res);
-void __dlm_kick_thread(struct dlm_ctxt *dlm, struct dlm_lock_resource *res);
 void __dlm_dirty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res);
 
 
 int dlm_nm_init(struct dlm_ctxt *dlm);
 int dlm_heartbeat_init(struct dlm_ctxt *dlm);
-void __dlm_hb_node_down(struct dlm_ctxt *dlm, int idx);
 void dlm_hb_node_down_cb(struct o2nm_node *node, int idx, void *data);
 void dlm_hb_node_up_cb(struct o2nm_node *node, int idx, void *data);
-int dlm_hb_node_dead(struct dlm_ctxt *dlm, int node);
-int __dlm_hb_node_dead(struct dlm_ctxt *dlm, int node);
 
 int dlm_lockres_is_dirty(struct dlm_ctxt *dlm, struct dlm_lock_resource *res);
 int dlm_migrate_lockres(struct dlm_ctxt *dlm,
@@ -777,7 +765,6 @@
 			       int ignore_higher,
 			       u8 request_from,
 			       u32 flags);
-void dlm_assert_master_worker(struct dlm_work_item *item, void *data);
 
 
 int dlm_send_one_lockres(struct dlm_ctxt *dlm,
@@ -788,11 +775,6 @@
 void dlm_move_lockres_to_recovery_list(struct dlm_ctxt *dlm,
 				       struct dlm_lock_resource *res);
 
-void dlm_init_lockres(struct dlm_ctxt *dlm,
-		      struct dlm_lock_resource *res,
-		      const char *name,
-		      unsigned int namelen);
-
 /* will exit holding res->spinlock, but may drop in function */
 void __dlm_wait_on_lockres_flags(struct dlm_lock_resource *res, int flags);
 void __dlm_wait_on_lockres_flags_set(struct dlm_lock_resource *res, int flags);
@@ -809,24 +791,11 @@
 int dlm_init_mle_cache(void);
 void dlm_destroy_mle_cache(void);
 void dlm_hb_event_notify_attached(struct dlm_ctxt *dlm, int idx, int node_up);
-int dlm_do_assert_master(struct dlm_ctxt *dlm,
-			 const char *lockname,
-			 unsigned int namelen,
-			 void *nodemap,
-			 u32 flags);
-int dlm_do_migrate_request(struct dlm_ctxt *dlm,
-			   struct dlm_lock_resource *res,
-			   u8 master,
-			   u8 new_master,
-			   struct dlm_node_iter *iter);
 void dlm_clean_master_list(struct dlm_ctxt *dlm,
 			   u8 dead_node);
 int dlm_lock_basts_flushed(struct dlm_ctxt *dlm, struct dlm_lock *lock);
 
 
-int dlm_dump_all_mles(const char __user *data, unsigned int len);
-
-
 static inline const char * dlm_lock_mode_name(int mode)
 {
 	switch (mode) {

Modified: trunk/fs/ocfs2/dlm/dlmdomain.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmdomain.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/dlm/dlmdomain.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -163,7 +163,7 @@
 }
 
 /* For null terminated domain strings ONLY */
-struct dlm_ctxt * __dlm_lookup_domain(const char *domain)
+static struct dlm_ctxt * __dlm_lookup_domain(const char *domain)
 {
 	assert_spin_locked(&dlm_domain_lock);
 
@@ -266,13 +266,6 @@
 	return target;
 }
 
-void dlm_get(struct dlm_ctxt *dlm)
-{
-	spin_lock(&dlm_domain_lock);
-	__dlm_get(dlm);
-	spin_unlock(&dlm_domain_lock);
-}
-
 int dlm_domain_fully_joined(struct dlm_ctxt *dlm)
 {
 	int ret;

Modified: trunk/fs/ocfs2/dlm/dlmdomain.h
===================================================================
--- trunk/fs/ocfs2/dlm/dlmdomain.h	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/dlm/dlmdomain.h	2005-10-31 20:20:26 UTC (rev 2672)
@@ -28,7 +28,6 @@
 extern spinlock_t dlm_domain_lock;
 extern struct list_head dlm_domains;
 
-struct dlm_ctxt * __dlm_lookup_domain(const char *domain);
 int dlm_joined(struct dlm_ctxt *dlm);
 int dlm_shutting_down(struct dlm_ctxt *dlm);
 void dlm_fire_domain_eviction_callbacks(struct dlm_ctxt *dlm,

Modified: trunk/fs/ocfs2/dlm/dlmlock.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmlock.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/dlm/dlmlock.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -62,6 +62,7 @@
 static void dlm_init_lock(struct dlm_lock *newlock, int type,
 			  u8 node, u64 cookie);
 static void dlm_lock_release(struct kref *kref);
+static void dlm_lock_detach_lockres(struct dlm_lock *lock);
 
 /* Tell us whether we can grant a new lock request.
  * locking:
@@ -312,7 +313,7 @@
 }
 
 /* drop ref on lockres, if there is still one associated with lock */
-void dlm_lock_detach_lockres(struct dlm_lock *lock)
+static void dlm_lock_detach_lockres(struct dlm_lock *lock)
 {
 	struct dlm_lock_resource *res;
 

Modified: trunk/fs/ocfs2/dlm/dlmmaster.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmmaster.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/dlm/dlmmaster.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -88,16 +88,19 @@
 	} u;
 };
 
-void dlm_print_one_mle(struct dlm_master_list_entry *mle);
+static void dlm_mle_node_down(struct dlm_ctxt *dlm,
+			      struct dlm_master_list_entry *mle,
+			      struct o2nm_node *node,
+			      int idx);
+static void dlm_mle_node_up(struct dlm_ctxt *dlm,
+			    struct dlm_master_list_entry *mle,
+			    struct o2nm_node *node,
+			    int idx);
 
-void dlm_mle_node_down(struct dlm_ctxt *dlm,
-		       struct dlm_master_list_entry *mle,
-		       struct o2nm_node *node,
-		       int idx);
-void dlm_mle_node_up(struct dlm_ctxt *dlm,
-		     struct dlm_master_list_entry *mle,
-		     struct o2nm_node *node,
-		     int idx);
+static void dlm_assert_master_worker(struct dlm_work_item *item, void *data);
+static int dlm_do_assert_master(struct dlm_ctxt *dlm, const char *lockname,
+				unsigned int namelen, void *nodemap,
+				u32 flags);
 
 static inline int dlm_mle_equal(struct dlm_ctxt *dlm,
 				struct dlm_master_list_entry *mle,
@@ -123,6 +126,9 @@
 	return 1;
 }
 
+#if 0
+/* Code here is included but defined out as it aids debugging */
+
 void dlm_print_one_mle(struct dlm_master_list_entry *mle)
 {
 	int i = 0, refs;
@@ -152,9 +158,6 @@
 		  namelen, namelen, name);
 }
 
-			      
-static void dlm_dump_mles(struct dlm_ctxt *dlm);
-
 static void dlm_dump_mles(struct dlm_ctxt *dlm)
 {
 	struct dlm_master_list_entry *mle;
@@ -189,7 +192,9 @@
 }
 EXPORT_SYMBOL_GPL(dlm_dump_all_mles);
 
+#endif  /*  0  */
 
+
 static kmem_cache_t *dlm_mle_cache = NULL;
 
 
@@ -419,8 +424,9 @@
 	}
 }
 
-void dlm_mle_node_down(struct dlm_ctxt *dlm, struct dlm_master_list_entry *mle,
-		       struct o2nm_node *node, int idx)
+static void dlm_mle_node_down(struct dlm_ctxt *dlm,
+			      struct dlm_master_list_entry *mle,
+			      struct o2nm_node *node, int idx)
 {
 	spin_lock(&mle->spinlock);
 
@@ -432,8 +438,9 @@
 	spin_unlock(&mle->spinlock);
 }
 
-void dlm_mle_node_up(struct dlm_ctxt *dlm, struct dlm_master_list_entry *mle,
-		     struct o2nm_node *node, int idx)
+static void dlm_mle_node_up(struct dlm_ctxt *dlm,
+			    struct dlm_master_list_entry *mle,
+			    struct o2nm_node *node, int idx)
 {
 	spin_lock(&mle->spinlock);
 
@@ -576,8 +583,9 @@
 	kref_put(&res->refs, dlm_lockres_release);
 }
 
-void dlm_init_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
-		      const char *name, unsigned int namelen)
+static void dlm_init_lockres(struct dlm_ctxt *dlm,
+			     struct dlm_lock_resource *res,
+			     const char *name, unsigned int namelen)
 {
 	char *qname;
 
@@ -1443,9 +1451,9 @@
  * can periodically run all locks owned by this node
  * and re-assert across the cluster...
  */
-int dlm_do_assert_master(struct dlm_ctxt *dlm, const char *lockname,
-			 unsigned int namelen, void *nodemap,
-			 u32 flags)
+static int dlm_do_assert_master(struct dlm_ctxt *dlm, const char *lockname,
+				unsigned int namelen, void *nodemap,
+				u32 flags)
 {
 	struct dlm_assert_master assert;
 	int to, tmpret;
@@ -1700,7 +1708,7 @@
 	return 0;
 }
 
-void dlm_assert_master_worker(struct dlm_work_item *item, void *data)
+static void dlm_assert_master_worker(struct dlm_work_item *item, void *data)
 {
 	struct dlm_ctxt *dlm = data;
 	int ret = 0;
@@ -2212,8 +2220,10 @@
 
 /* this is called by the new master once all lockres
  * data has been received */
-int dlm_do_migrate_request(struct dlm_ctxt *dlm, struct dlm_lock_resource *res,
-			   u8 master, u8 new_master, struct dlm_node_iter *iter)
+static int dlm_do_migrate_request(struct dlm_ctxt *dlm,
+				  struct dlm_lock_resource *res,
+				  u8 master, u8 new_master,
+				  struct dlm_node_iter *iter)
 {
 	struct dlm_migrate_request migrate;
 	int ret, status = 0;

Modified: trunk/fs/ocfs2/dlm/dlmrecovery.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmrecovery.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/dlm/dlmrecovery.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -57,15 +57,15 @@
 static int dlm_recovery_thread(void *data);
 void dlm_complete_recovery_thread(struct dlm_ctxt *dlm);
 int dlm_launch_recovery_thread(struct dlm_ctxt *dlm);
-void dlm_kick_recovery_thread(struct dlm_ctxt *dlm);
-int dlm_do_recovery(struct dlm_ctxt *dlm);
+static void dlm_kick_recovery_thread(struct dlm_ctxt *dlm);
+static int dlm_do_recovery(struct dlm_ctxt *dlm);
 
-int dlm_pick_recovery_master(struct dlm_ctxt *dlm);
+static int dlm_pick_recovery_master(struct dlm_ctxt *dlm);
 static int dlm_remaster_locks(struct dlm_ctxt *dlm, u8 dead_node);
-int dlm_init_recovery_area(struct dlm_ctxt *dlm, u8 dead_node);
-int dlm_request_all_locks(struct dlm_ctxt *dlm,
-			  u8 request_from, u8 dead_node);
-void dlm_destroy_recovery_area(struct dlm_ctxt *dlm, u8 dead_node);
+static int dlm_init_recovery_area(struct dlm_ctxt *dlm, u8 dead_node);
+static int dlm_request_all_locks(struct dlm_ctxt *dlm,
+				 u8 request_from, u8 dead_node);
+static void dlm_destroy_recovery_area(struct dlm_ctxt *dlm, u8 dead_node);
 
 static inline int dlm_num_locks_in_lockres(struct dlm_lock_resource *res);
 static void dlm_init_migratable_lockres(struct dlm_migratable_lockres *mres,
@@ -164,7 +164,7 @@
  * RECOVERY THREAD
  */
 
-void dlm_kick_recovery_thread(struct dlm_ctxt *dlm)
+static void dlm_kick_recovery_thread(struct dlm_ctxt *dlm)
 {
 	/* wake the recovery thread
 	 * this will wake the reco thread in one of three places
@@ -294,7 +294,7 @@
 	wake_up(&dlm->reco.event);
 }
 
-int dlm_do_recovery(struct dlm_ctxt *dlm)
+static int dlm_do_recovery(struct dlm_ctxt *dlm)
 {
 	int status = 0;
 
@@ -538,7 +538,7 @@
 	return status;
 }
 
-int dlm_init_recovery_area(struct dlm_ctxt *dlm, u8 dead_node)
+static int dlm_init_recovery_area(struct dlm_ctxt *dlm, u8 dead_node)
 {
 	int num=0;
 	struct dlm_reco_node_data *ndata;
@@ -572,7 +572,7 @@
 	return 0;
 }
 
-void dlm_destroy_recovery_area(struct dlm_ctxt *dlm, u8 dead_node)
+static void dlm_destroy_recovery_area(struct dlm_ctxt *dlm, u8 dead_node)
 {
 	struct list_head *iter, *iter2;
 	struct dlm_reco_node_data *ndata;
@@ -589,7 +589,8 @@
 	}
 }
 
-int dlm_request_all_locks(struct dlm_ctxt *dlm, u8 request_from, u8 dead_node)
+static int dlm_request_all_locks(struct dlm_ctxt *dlm, u8 request_from,
+				 u8 dead_node)
 {
 	struct dlm_lock_request lr;
 	enum dlm_status ret;
@@ -1784,7 +1785,7 @@
 
 }
 
-void __dlm_hb_node_down(struct dlm_ctxt *dlm, int idx)
+static void __dlm_hb_node_down(struct dlm_ctxt *dlm, int idx)
 {
 	assert_spin_locked(&dlm->spinlock);
 
@@ -1865,22 +1866,6 @@
 	dlm_put(dlm);
 }
 
-int __dlm_hb_node_dead(struct dlm_ctxt *dlm, int node)
-{
-	if (test_bit(node, dlm->recovery_map))
-		return 1;
-	return 0;
-}
-
-int dlm_hb_node_dead(struct dlm_ctxt *dlm, int node)
-{
-	int ret;
-	spin_lock(&dlm->spinlock);
-	ret = __dlm_hb_node_dead(dlm, node);
-	spin_unlock(&dlm->spinlock);
-	return ret;
-}
-
 static void dlm_reco_ast(void *astdata)
 {
 	struct dlm_ctxt *dlm = astdata;
@@ -1899,7 +1884,7 @@
 }
 
 
-int dlm_pick_recovery_master(struct dlm_ctxt *dlm)
+static int dlm_pick_recovery_master(struct dlm_ctxt *dlm)
 {
 	enum dlm_status ret;
 	struct dlm_lockstatus lksb;

Modified: trunk/fs/ocfs2/dlm/dlmthread.c
===================================================================
--- trunk/fs/ocfs2/dlm/dlmthread.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/dlm/dlmthread.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -57,6 +57,8 @@
 
 static int dlm_thread(void *data);
 
+static void dlm_flush_asts(struct dlm_ctxt *dlm);
+
 #define dlm_lock_is_remote(dlm, lock)     ((lock)->ml.node != (dlm)->node_num)
 
 /* will exit holding res->spinlock, but may drop in function */
@@ -236,7 +238,8 @@
 	spin_unlock(&dlm->spinlock);
 }
 
-void dlm_shuffle_lists(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
+static void dlm_shuffle_lists(struct dlm_ctxt *dlm,
+			      struct dlm_lock_resource *res)
 {
 	struct dlm_lock *lock, *target;
 	struct list_head *iter;
@@ -412,15 +415,6 @@
 	wake_up(&dlm->dlm_thread_wq);
 }
 
-void __dlm_kick_thread(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
-{
-	mlog_entry("dlm=%p, res=%p\n", dlm, res);
-	if (res)
-		__dlm_dirty_lockres(dlm, res);
-
-	wake_up(&dlm->dlm_thread_wq);
-}
-
 void __dlm_dirty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
 {
 	mlog_entry("dlm=%p, res=%p\n", dlm, res);
@@ -472,15 +466,8 @@
 	return empty;
 }
 
-int dlm_flush_lockres_asts(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
+static void dlm_flush_asts(struct dlm_ctxt *dlm)
 {
-	dlm_flush_asts(dlm);
-	/* still need to implement dlm_flush_lockres_asts */
-	return 0;
-}
-
-void dlm_flush_asts(struct dlm_ctxt *dlm)
-{
 	int ret;
 	struct dlm_lock *lock;
 	struct dlm_lock_resource *res;

Modified: trunk/fs/ocfs2/extent_map.c
===================================================================
--- trunk/fs/ocfs2/extent_map.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/extent_map.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -69,6 +69,8 @@
 			u32 cpos, u32 clusters,
 			struct rb_node ***ret_p,
 			struct rb_node **ret_parent);
+static int ocfs2_extent_map_insert(struct inode *inode, ocfs2_extent_rec *rec,
+				   int tree_depth);
 static int ocfs2_extent_map_insert_entry(struct ocfs2_extent_map *em,
 					 struct ocfs2_extent_map_entry *ent);
 static int ocfs2_extent_map_find_leaf(struct inode *inode,
@@ -482,8 +484,8 @@
 }
 
 
-int ocfs2_extent_map_insert(struct inode *inode, ocfs2_extent_rec *rec,
-			    int tree_depth)
+static int ocfs2_extent_map_insert(struct inode *inode, ocfs2_extent_rec *rec,
+				   int tree_depth)
 {
 	int ret;
 	struct ocfs2_em_insert_context ctxt = {0, };
@@ -633,6 +635,10 @@
 	return ret;
 }
 
+#if 0
+/* Code here is included but defined out as it completes the extent
+ * map api and may be used in the future. */
+
 /*
  * Look up the record containing this cluster offset.  This record is
  * part of the extent map.  Do not free it.  Any changes you make to
@@ -736,6 +742,8 @@
 	return -ENOENT;
 }
 
+#endif  /*  0  */
+
 int ocfs2_extent_map_get_blocks(struct inode *inode,
 				u64 v_blkno, int count,
 				u64 *p_blkno, int *ret_count)

Modified: trunk/fs/ocfs2/extent_map.h
===================================================================
--- trunk/fs/ocfs2/extent_map.h	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/extent_map.h	2005-10-31 20:20:26 UTC (rev 2672)
@@ -34,16 +34,8 @@
  * in the process of being updated.
  */
 int ocfs2_extent_map_init(struct inode *inode);
-int ocfs2_extent_map_insert(struct inode *inode, ocfs2_extent_rec *rec,
-			    int tree_depth);
 int ocfs2_extent_map_append(struct inode *inode, ocfs2_extent_rec *rec,
 			    u32 new_clusters);
-int ocfs2_extent_map_get_rec(struct inode *inode, u32 cpos,
-			     ocfs2_extent_rec **rec,
-			     int *tree_depth);
-int ocfs2_extent_map_get_clusters(struct inode *inode,
-				  u32 v_cpos, int count,
-			  	  u32 *p_cpos, int *ret_count);
 int ocfs2_extent_map_get_blocks(struct inode *inode,
 				u64 v_blkno, int count,
 				u64 *p_blkno, int *ret_count);

Modified: trunk/fs/ocfs2/file.c
===================================================================
--- trunk/fs/ocfs2/file.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/file.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -56,7 +56,7 @@
 				     struct buffer_head *fe_bh,
 				     u64 new_i_size);
 
-int ocfs2_sync_inode(struct inode *inode)
+static int ocfs2_sync_inode(struct inode *inode)
 {
 	filemap_fdatawrite(inode->i_mapping);
 	return sync_mapping_buffers(inode->i_mapping);

Modified: trunk/fs/ocfs2/file.h
===================================================================
--- trunk/fs/ocfs2/file.h	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/file.h	2005-10-31 20:20:26 UTC (rev 2672)
@@ -47,7 +47,6 @@
 int ocfs2_setattr(struct dentry *dentry, struct iattr *attr);
 int ocfs2_getattr(struct vfsmount *mnt, struct dentry *dentry,
 		  struct kstat *stat);
-int ocfs2_sync_inode(struct inode *inode);
 int ocfs2_extend_file(ocfs2_super *osb,
 		      struct inode *inode,
 		      u64 new_i_size,

Modified: trunk/fs/ocfs2/ver.c
===================================================================
--- trunk/fs/ocfs2/ver.c	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/ver.c	2005-10-31 20:20:26 UTC (rev 2672)
@@ -37,11 +37,6 @@
 	printk(KERN_INFO "%s\n", VERSION_STR);
 }
 
-int ocfs2_str_version(char *buf)
-{
-	return sprintf(buf, "%s\n", VERSION_STR);
-}
-
 MODULE_DESCRIPTION(VERSION_STR);
 
 #ifdef MODULE_VERSION

Modified: trunk/fs/ocfs2/ver.h
===================================================================
--- trunk/fs/ocfs2/ver.h	2005-10-31 20:16:56 UTC (rev 2671)
+++ trunk/fs/ocfs2/ver.h	2005-10-31 20:20:26 UTC (rev 2672)
@@ -27,6 +27,5 @@
 #define OCFS2_VER_H
 
 void ocfs2_print_version(void);
-int ocfs2_str_version(char *buf);
 
 #endif /* OCFS2_VER_H */



More information about the Ocfs2-commits mailing list