[Ocfs2-commits] mfasheh commits r1598 - branches/dlm-glue/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Oct 28 15:37:00 CDT 2004


Author: mfasheh
Date: 2004-10-28 15:36:58 -0500 (Thu, 28 Oct 2004)
New Revision: 1598

Modified:
   branches/dlm-glue/src/dlmglue.c
   branches/dlm-glue/src/journal.c
   branches/dlm-glue/src/ocfs.h
   branches/dlm-glue/src/super.c
Log:
* provide some more stubs, remove a now useless semaphore.



Modified: branches/dlm-glue/src/dlmglue.c
===================================================================
--- branches/dlm-glue/src/dlmglue.c	2004-10-28 20:06:50 UTC (rev 1597)
+++ branches/dlm-glue/src/dlmglue.c	2004-10-28 20:36:58 UTC (rev 1598)
@@ -1025,7 +1025,7 @@
 	memcpy(domain, osb->uuid, MAX_VOL_ID_LENGTH);
 
 	/* where to get group name from? */
-	dlm = dlm_register_domain(domain, "testgroup", 0);
+	dlm = dlm_register_domain(domain, osb->group_name, 0);
 	if (!dlm) {
 		/* This is a best guess on return value... */
 		status = -ENOMEM;

Modified: branches/dlm-glue/src/journal.c
===================================================================
--- branches/dlm-glue/src/journal.c	2004-10-28 20:06:50 UTC (rev 1597)
+++ branches/dlm-glue/src/journal.c	2004-10-28 20:36:58 UTC (rev 1598)
@@ -953,12 +953,10 @@
 		goto done;
 	}
 
-	down(&(osb->osb_res));
 	/* Launch the commit thread */
 	osb->commit = ocfs_malloc(sizeof(ocfs_commit_task));
 	if (osb->commit == NULL) {
 		LOG_ERROR_STATUS(status = -ENOMEM);
-		up (&(osb->osb_res));
 		goto done;
 	}
 	memset(osb->commit, 0, sizeof(ocfs_commit_task));
@@ -967,13 +965,11 @@
 	if (child_pid < 0) {
 		LOG_ERROR_ARGS ("unable to launch ocfs2commit thread, error=%d",
 				child_pid);
-		up (&(osb->osb_res));
 		status = child_pid;
 		goto done;
 	} else {
 		init_completion (&osb->commit->c_complete);
 	}
-	up (&(osb->osb_res));
 
 done:
 	LOG_EXIT_STATUS(status);

Modified: branches/dlm-glue/src/ocfs.h
===================================================================
--- branches/dlm-glue/src/ocfs.h	2004-10-28 20:06:50 UTC (rev 1597)
+++ branches/dlm-glue/src/ocfs.h	2004-10-28 20:36:58 UTC (rev 1598)
@@ -434,7 +434,6 @@
  */
 struct _ocfs_super
 {
-	struct semaphore osb_res; /* resource to protect the ocfs_super */
 	struct list_head osb_next;	/* list of ocfs_super(s) */
 	__u32 osb_id;		/* id used by the proc interface */
 	ocfs_commit_task *commit;
@@ -512,6 +511,7 @@
 	ocfs_alloc_stats alloc_stats;
 	char dev_str[20];		/* "major,minor" of the device */
 
+	char *group_name;
 	dlm_ctxt *dlm;
 
 	wait_queue_head_t recovery_event;

Modified: branches/dlm-glue/src/super.c
===================================================================
--- branches/dlm-glue/src/super.c	2004-10-28 20:06:50 UTC (rev 1597)
+++ branches/dlm-glue/src/super.c	2004-10-28 20:36:58 UTC (rev 1598)
@@ -179,6 +179,7 @@
 static int ocfs_init_global_system_inodes(ocfs_super *osb);
 static int ocfs_init_local_system_inodes(ocfs_super *osb);
 static int ocfs_release_system_inodes(ocfs_super *osb);
+static int ocfs2_fill_node_info(ocfs_super *osb);
 static int ocfs_check_volume(ocfs_super * osb);
 static int ocfs_verify_volume(ocfs2_dinode *di, struct buffer_head *bh,
 			      __u32 sectsize);
@@ -920,7 +921,29 @@
 	return 0;
 }
 
+static int ocfs2_fill_node_info(ocfs_super *osb)
+{
+	int status;
+	/* get the required node information from the group services /
+	 * node management stuff. For now we hard code these
+	 * things. */
 
+	osb->node_num = 0;
+
+	osb->group_name = kmalloc(NM_MAX_NAME_LEN, GFP_KERNEL);
+	if (!osb->group_name) {
+		status = -ENOMEM;
+		LOG_ERROR_STATUS(status);
+		goto bail;
+	}
+	memset(osb->group_name, 0, NM_MAX_NAME_LEN);
+	sprintf(osb->group_name, "%s", "testgroup");
+
+	status = 0;
+bail:
+	return status;
+}
+
 /*
  * ocfs_mount_volume()
  *
@@ -965,6 +988,12 @@
 		goto leave;
 	}
 
+	status = ocfs2_fill_node_info(osb);
+	if (status < 0) {
+		LOG_ERROR_STATUS (status);
+		goto leave;
+	}
+
 	status = ocfs2_register_hb_callbacks(osb);
 	if (status < 0) {
 		LOG_ERROR_STATUS (status);
@@ -1022,8 +1051,6 @@
 		schedule();
 	}
 
-	down(&(osb->osb_res));
-
 	ocfs_shutdown_local_alloc(osb);
 	ocfs_journal_shutdown(osb);
 
@@ -1042,7 +1069,6 @@
 	ocfs_uninitialize_bitmap(&osb->cluster_bitmap);
 
 	atomic_set(&osb->vol_state, VOLUME_DISMOUNTED);
-	up (&(osb->osb_res));
 
 	printk ("ocfs2: Unmounting device (%u,%u) on %s (node %d)\n",
 		MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev),
@@ -1166,7 +1192,6 @@
 	snprintf(osb->dev_str, sizeof(osb->dev_str), "%u,%u",
 		 MAJOR(osb->sb->s_dev), MINOR(osb->sb->s_dev));
 
-	init_MUTEX (&(osb->osb_res));
 	init_MUTEX (&(osb->recovery_lock));
 	init_MUTEX (&(osb->orphan_recovery_lock));
 	init_MUTEX (&(osb->cfg_lock));
@@ -1569,6 +1594,8 @@
 	 * we free it here.
 	 */
 	kfree(osb->journal);
+	if (osb->group_name)
+		kfree(osb->group_name);
 
 	memset (osb, 0, sizeof (ocfs_super));
 



More information about the Ocfs2-commits mailing list