[Ocfs2-commits] mfasheh commits r863 - in trunk/src: . inc

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Apr 22 15:46:14 CDT 2004


Author: mfasheh
Date: 2004-04-22 14:46:12 -0500 (Thu, 22 Apr 2004)
New Revision: 863

Modified:
   trunk/src/inc/ocfs.h
   trunk/src/osb.c
   trunk/src/super.c
   trunk/src/vote.c
Log:
* Turn OcfsGlobalCtxt.res into a struct semaphore. Also, rename it to
  "global_res" as that's more descriptive and is easier to search on :)
  This leaves only 4 ocfs_sem's in the system.



Modified: trunk/src/inc/ocfs.h
===================================================================
--- trunk/src/inc/ocfs.h	2004-04-22 18:51:22 UTC (rev 862)
+++ trunk/src/inc/ocfs.h	2004-04-22 19:46:12 UTC (rev 863)
@@ -1997,7 +1997,7 @@
 typedef struct _ocfs_global_ctxt
 {
 	ocfs_obj_id obj_id;
-	ocfs_sem res;
+	struct semaphore global_res;
 	struct list_head osb_next;	/* List of all volumes */
 	kmem_cache_t *inode_cache;
 	kmem_cache_t *ofile_cache;

Modified: trunk/src/osb.c
===================================================================
--- trunk/src/osb.c	2004-04-22 18:51:22 UTC (rev 862)
+++ trunk/src/osb.c	2004-04-22 19:46:12 UTC (rev 863)
@@ -228,9 +228,9 @@
 
 	/*  Link this osb onto the global linked list of all osb structures. */
 	/*  The Global Link List is mainted for the whole driver . */
-	ocfs_down_sem (&(OcfsGlobalCtxt.res), true);
+	down (&(OcfsGlobalCtxt.global_res));
 	list_add_tail (&(osb->osb_next), &(OcfsGlobalCtxt.osb_next));
-	ocfs_up_sem (&(OcfsGlobalCtxt.res));
+	up (&(OcfsGlobalCtxt.global_res));
 
 	/*  Mark the fact that this osb structure is initialized. */
 	OCFS_SET_FLAG (osb->osb_flags, OCFS_OSB_FLAGS_OSB_INITIALIZED);
@@ -465,10 +465,10 @@
 
 	/* Remove the osb from the global linked list of all osb structures. */
 	/* The Global Link List is mainted for the whole driver */
-	ocfs_down_sem (&(OcfsGlobalCtxt.res), true);
+	down (&(OcfsGlobalCtxt.global_res));
 	if (!list_empty(&(osb->osb_next)))
 		list_del (&(osb->osb_next));
-	ocfs_up_sem (&(OcfsGlobalCtxt.res));
+	up (&(OcfsGlobalCtxt.global_res));
 
 	for (i=0; i<32; i++)
 		ocfs_recover_oin_locks(osb, i);

Modified: trunk/src/super.c
===================================================================
--- trunk/src/super.c	2004-04-22 18:51:22 UTC (rev 862)
+++ trunk/src/super.c	2004-04-22 19:46:12 UTC (rev 863)
@@ -406,7 +406,7 @@
 	OcfsGlobalCtxt.obj_id.size = sizeof (ocfs_global_ctxt);
 
 	/* Initialize the global data resource */
-	ocfs_init_sem (&(OcfsGlobalCtxt.res));
+	init_MUTEX (&(OcfsGlobalCtxt.global_res));
 	OCFS_SET_FLAG (OcfsGlobalCtxt.flags, OCFS_FLAG_GLBL_CTXT_RESOURCE_INITIALIZED);
 
 	/* Initialize the memory slabs for oin, ofile, and file entry */
@@ -599,7 +599,7 @@
         	unregister_sysctl_table(ocfs_table_header);
 
 	/* Signal DLM thread to exit */
-	ocfs_down_sem (&(OcfsGlobalCtxt.res), true);
+	down (&(OcfsGlobalCtxt.global_res));
 	OCFS_SET_FLAG (OcfsGlobalCtxt.flags, OCFS_FLAG_SHUTDOWN_VOL_THREAD);
 
 	if (ocfs_bh_sem_hash_destroy() < 0) 
@@ -608,7 +608,7 @@
 	if (OcfsGlobalCtxt.flags & OCFS_FLAG_MEM_LISTS_INITIALIZED)
 		ocfs_free_mem_lists ();
 
-	ocfs_up_sem (&(OcfsGlobalCtxt.res));
+	up (&(OcfsGlobalCtxt.global_res));
 
 	/* Deinit the proc interface */
 	ocfs_proc_deinit ();
@@ -1138,10 +1138,10 @@
 	}
 	spin_unlock (&mount_cnt_lock);
 
-	ocfs_down_sem (&(OcfsGlobalCtxt.res), true);
+	down (&(OcfsGlobalCtxt.global_res));
 	ocfs_uninitialize_bitmap(&osb->cluster_bitmap);
 //    list_del(&osb->osb_next);  /* this has been moved into ocfs_delete_osb */
-	ocfs_up_sem (&(OcfsGlobalCtxt.res));
+	up (&(OcfsGlobalCtxt.global_res));
 
 	/* destroy the inode hash */
 	ocfs_inode_hash_destroy(&osb->inode_hash);

Modified: trunk/src/vote.c
===================================================================
--- trunk/src/vote.c	2004-04-22 18:51:22 UTC (rev 862)
+++ trunk/src/vote.c	2004-04-22 19:46:12 UTC (rev 863)
@@ -620,7 +620,7 @@
 
 	dlm_msg = (ocfs_dlm_msg *) msg;
 
-	ocfs_down_sem (&(OcfsGlobalCtxt.res), true);
+	down (&(OcfsGlobalCtxt.global_res));
 	list_for_each_safe (iter_osb, temp_iter, &(OcfsGlobalCtxt.osb_next)) {
 		osb = list_entry (iter_osb, ocfs_super, osb_next);
 		if (!memcmp (osb->vol_layout.vol_id, dlm_msg->vol_id,
@@ -628,7 +628,7 @@
 			break;
 		osb = NULL;
 	}
-	ocfs_up_sem (&(OcfsGlobalCtxt.res));
+	up (&(OcfsGlobalCtxt.global_res));
 	
 	if (osb == NULL) {
 		LOG_TRACE_STR("Ignoring netdlm message with invalid volume id");



More information about the Ocfs2-commits mailing list