[Ocfs2-tools-commits] jlbec commits r1393 - in branches/cman-based: fsck.ocfs2 libo2cb libo2cb/include libocfs2 libocfs2/include mkfs.ocfs2 mount.ocfs2 ocfs2_hb_ctl tunefs.ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Aug 17 14:27:35 PDT 2007


Author: jlbec
Date: 2007-08-17 14:27:31 -0700 (Fri, 17 Aug 2007)
New Revision: 1393

Modified:
   branches/cman-based/fsck.ocfs2/fsck.c
   branches/cman-based/libo2cb/include/o2cb.h
   branches/cman-based/libo2cb/o2cb_abi.c
   branches/cman-based/libocfs2/dlm.c
   branches/cman-based/libocfs2/heartbeat.c
   branches/cman-based/libocfs2/include/ocfs2.h
   branches/cman-based/mkfs.ocfs2/check.c
   branches/cman-based/mount.ocfs2/mount.ocfs2.c
   branches/cman-based/mount.ocfs2/umount.ocfs2.c
   branches/cman-based/ocfs2_hb_ctl/ocfs2_hb_ctl.c
   branches/cman-based/tunefs.ocfs2/tunefs.c
Log:

Change the heartbeat API for o2cb.
- o2cb_[start|stop]_heartbeat_region() have been replaced by
  o2cb_begin_group_join(), o2cb_complete_group_join(), and
  o2cb_group_leave().  These functions now take a service name to describe
  who is accessing the region.  The service is usually the mountpoint,
  but tools will use their program name.
- Failed mounts pass an error to o2cb_complete_group_join(), which will
  handle stopping any started region.  Thus, failed mounts should not
  call o2cb_group_leave() like they used to call
  o2cb_stop_heartbeat_region().
- mount.ocfs2 called ocfs2_hb_ctl to start heartbeat.  However, for cman
  it will need to call o2cb_begin_group_join() and
  o2cb_complete_group_join() from the same process. Thus, mount.ocfs2 now
  calls the library directly.
- umount.ocfs2 is introduced to call o2cb_group_leave() after umount(2).
  This works for all kernel versions, and the kernel doesn't run
  ocfs2_hb_ctl anymore (This is filled in by /bin/true in an earlier
  commit.  The kernel actually still makes the call, but it is a no-op).
- All of the other tools never called ocfs2_hb_ctl.  They call
  ocfs2_initalize_dlm() and ocfs2_shutdown_dlm().  These functions have
  been changed to call the new o2cb_group_* API.  This works for all
  tools.
- ocfs2_hb_ctl is now only useful for querying the state and
  starting/stopping regions by hand.  That's still needed, as it is
  possible to wedge a region with a kill -9 or something.



Modified: branches/cman-based/fsck.ocfs2/fsck.c
===================================================================
--- branches/cman-based/fsck.ocfs2/fsck.c	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/fsck.ocfs2/fsck.c	2007-08-17 21:27:31 UTC (rev 1393)
@@ -630,7 +630,7 @@
 			goto close;
 		}
 
-		ret = ocfs2_initialize_dlm(ost->ost_fs);
+		ret = ocfs2_initialize_dlm(ost->ost_fs, whoami);
 		if (ret) {
 			com_err(whoami, ret, "while initializing the DLM");
 			goto close;
@@ -745,7 +745,7 @@
 
 close:
 	if (ost->ost_fs->fs_dlm_ctxt)
-		ocfs2_shutdown_dlm(ost->ost_fs);
+		ocfs2_shutdown_dlm(ost->ost_fs, whoami);
 
 	ret = ocfs2_close(ost->ost_fs);
 	if (ret) {

Modified: branches/cman-based/libo2cb/include/o2cb.h
===================================================================
--- branches/cman-based/libo2cb/include/o2cb.h	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/libo2cb/include/o2cb.h	2007-08-17 21:27:31 UTC (rev 1393)
@@ -81,24 +81,27 @@
 void o2cb_free_nodes_list(char **nodes);
 
 struct o2cb_region_desc {
-	char		*r_name;
-	char		*r_device_name;
+	char		*r_name;	/* The uuid of the region */
+	char		*r_device_name; /* The device the region is on */
+	char		*r_service;	/* A program or mountpoint */
 	int		r_block_bytes;
 	uint64_t	r_start_block;
 	uint64_t	r_blocks;
+	int		r_persist;	/* Persist past process exit */
 };
 
 /* Expected use case for the region descriptor is to allocate it on
  * the stack and completely fill it before calling
- * start_heartbeat_region. */
-errcode_t o2cb_start_heartbeat_region(const char *cluster_name,
-				      struct o2cb_region_desc *desc);
-errcode_t o2cb_stop_heartbeat_region(const char *cluster_name,
-				     const char *region_name);
-errcode_t o2cb_start_heartbeat_region_perm(const char *cluster_name,
-					   struct o2cb_region_desc *desc);
-errcode_t o2cb_stop_heartbeat_region_perm(const char *cluster_name,
-					  const char *region_name);
+ * begin_group_join().  Regular programs (not mount.ocfs2) should provide
+ * a mountpoint that does not begin with a '/'.  Eg, fsck could use ":fsck"
+ */
+errcode_t o2cb_begin_group_join(const char *cluster_name,
+				struct o2cb_region_desc *desc);
+errcode_t o2cb_complete_group_join(const char *cluster_name,
+				   struct o2cb_region_desc *desc,
+				   int error);
+errcode_t o2cb_group_leave(const char *cluster_name,
+			   struct o2cb_region_desc *desc);
 
 errcode_t o2cb_get_hb_thread_pid (const char *cluster_name, 
 				  const char *region_name, 

Modified: branches/cman-based/libo2cb/o2cb_abi.c
===================================================================
--- branches/cman-based/libo2cb/o2cb_abi.c	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/libo2cb/o2cb_abi.c	2007-08-17 21:27:31 UTC (rev 1393)
@@ -996,15 +996,14 @@
  * to drop the reference taken during startup, otherwise that
  * reference was dropped automatically at process shutdown so there's
  * no need to drop one here. */
-static errcode_t __o2cb_stop_heartbeat_region(const char *cluster_name,
-					      const char *region_name,
-					      int undo)
+errcode_t o2cb_group_leave(const char *cluster_name,
+			   struct o2cb_region_desc *desc)
 {
 	errcode_t ret, up_ret;
 	int hb_refs;
 	int semid;
 
-	ret = o2cb_mutex_down_lookup(region_name, &semid);
+	ret = o2cb_mutex_down_lookup(desc->r_name, &semid);
 	if (ret)
 		return ret;
 
@@ -1016,7 +1015,7 @@
 	 * references on the region. We avoid a negative error count
 	 * here and clean up the region as normal. */
 	if (hb_refs) {
-		ret = __o2cb_drop_ref(semid, undo);
+		ret = __o2cb_drop_ref(semid, !desc->r_persist);
 		if (ret)
 			goto up;
 
@@ -1028,7 +1027,8 @@
 	if (!hb_refs) {
 		/* XXX: If this fails, shouldn't we still destroy the
 		 * semaphore set? */
-		ret = o2cb_remove_heartbeat_region(cluster_name, region_name);
+		ret = o2cb_remove_heartbeat_region(cluster_name,
+						   desc->r_name);
 		if (ret)
 			goto up;
 
@@ -1047,9 +1047,8 @@
 	return ret;
 }
 
-static errcode_t __o2cb_start_heartbeat_region(const char *cluster_name,
-					       struct o2cb_region_desc *desc,
-					       int undo)
+errcode_t o2cb_begin_group_join(const char *cluster_name,
+				struct o2cb_region_desc *desc)
 {
 	errcode_t ret, up_ret;
 	int semid;
@@ -1067,7 +1066,7 @@
 	if (ret && ret != O2CB_ET_REGION_EXISTS)
 		goto up;
 
-	ret = __o2cb_get_ref(semid, undo);
+	ret = __o2cb_get_ref(semid, !desc->r_persist);
 	/* XXX: Maybe stop heartbeat on error here? */
 up:
 	up_ret = o2cb_mutex_up(semid);
@@ -1077,30 +1076,18 @@
 	return ret;
 }
 
-errcode_t o2cb_start_heartbeat_region(const char *cluster_name,
-				      struct o2cb_region_desc *desc)
+errcode_t o2cb_complete_group_join(const char *cluster_name,
+				   struct o2cb_region_desc *desc,
+				   int error)
 {
-	return __o2cb_start_heartbeat_region(cluster_name, desc, 1);
-}
+	errcode_t ret = 0;
 
-errcode_t o2cb_stop_heartbeat_region(const char *cluster_name,
-				     const char *region_name)
-{
-	return __o2cb_stop_heartbeat_region(cluster_name, region_name, 1);
-}
+	if (error)
+		ret = o2cb_group_leave(cluster_name, desc);
 
-errcode_t o2cb_start_heartbeat_region_perm(const char *cluster_name,
-					   struct o2cb_region_desc *desc)
-{
-	return __o2cb_start_heartbeat_region(cluster_name, desc, 0);
+	return ret;
 }
 
-errcode_t o2cb_stop_heartbeat_region_perm(const char *cluster_name,
-					  const char *region_name)
-{
-	return __o2cb_stop_heartbeat_region(cluster_name, region_name, 0);
-}
-
 static inline int is_dots(const char *name)
 {
 	size_t len = strlen(name);

Modified: branches/cman-based/libocfs2/dlm.c
===================================================================
--- branches/cman-based/libocfs2/dlm.c	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/libocfs2/dlm.c	2007-08-17 21:27:31 UTC (rev 1393)
@@ -101,31 +101,47 @@
 	return ret;
 }
 
-errcode_t ocfs2_initialize_dlm(ocfs2_filesys *fs)
+errcode_t ocfs2_initialize_dlm(ocfs2_filesys *fs, const char *service)
 {
 	struct o2dlm_ctxt *dlm_ctxt = NULL;
 	errcode_t ret = 0;
+	struct o2cb_region_desc desc;
 
-	ret = ocfs2_start_heartbeat(fs);
+	ret = ocfs2_fill_heartbeat_desc(fs, &desc);
 	if (ret)
 		goto bail;
 
+	desc.r_service = (char *)service;
+	desc.r_persist = 0;
+	ret = o2cb_begin_group_join(NULL, &desc);
+	if (ret)
+		goto bail;
+
 	ret = o2dlm_initialize(DEFAULT_DLMFS_PATH, fs->uuid_str, &dlm_ctxt);
 	if (ret) {
 		/* What to do with an error code? */
-		ocfs2_stop_heartbeat(fs);
+
+		/* Ignore the result of complete_group_join, as we want
+		 * to propagate our o2dlm_initialize() error */
+		o2cb_complete_group_join(NULL, &desc, ret);
 		goto bail;
 	}
 
-	fs->fs_dlm_ctxt = dlm_ctxt;
+	ret = o2cb_complete_group_join(NULL, &desc, 0);
 
+	if (!ret) 
+		fs->fs_dlm_ctxt = dlm_ctxt;
+	else
+		o2dlm_destroy(dlm_ctxt);
+
 bail:
 	return ret;
 }
 
-errcode_t ocfs2_shutdown_dlm(ocfs2_filesys *fs)
+errcode_t ocfs2_shutdown_dlm(ocfs2_filesys *fs, const char *service)
 {
 	errcode_t ret;
+	struct o2cb_region_desc desc;
 
 	ret = o2dlm_destroy(fs->fs_dlm_ctxt);
 	if (ret)
@@ -133,8 +149,14 @@
 
 	fs->fs_dlm_ctxt = NULL;
 
-	ret = ocfs2_stop_heartbeat(fs);
+	ret = ocfs2_fill_heartbeat_desc(fs, &desc);
+	if (ret)
+		goto bail;
 
+	desc.r_service = (char *)service;
+	desc.r_persist = 0;
+	ret = o2cb_group_leave(NULL, &desc);
+
 bail:
 	return ret;
 }

Modified: branches/cman-based/libocfs2/heartbeat.c
===================================================================
--- branches/cman-based/libocfs2/heartbeat.c	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/libocfs2/heartbeat.c	2007-08-17 21:27:31 UTC (rev 1393)
@@ -111,23 +111,3 @@
 	return ret;
 }
 
-errcode_t ocfs2_start_heartbeat(ocfs2_filesys *fs)
-{
-	errcode_t ret;
-	struct o2cb_region_desc desc;
-
-	ret = ocfs2_fill_heartbeat_desc(fs, &desc);	
-	if (ret)
-		goto leave;
-
-        /* XXX: NULL cluster is a hack for right now */
-	ret = o2cb_start_heartbeat_region(NULL, &desc);
-
-leave:
-	return ret;
-}
-
-errcode_t ocfs2_stop_heartbeat(ocfs2_filesys *fs)
-{
-	return o2cb_stop_heartbeat_region(NULL, fs->uuid_str);
-}

Modified: branches/cman-based/libocfs2/include/ocfs2.h
===================================================================
--- branches/cman-based/libocfs2/include/ocfs2.h	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/libocfs2/include/ocfs2.h	2007-08-17 21:27:31 UTC (rev 1393)
@@ -579,17 +579,13 @@
 errcode_t ocfs2_fill_heartbeat_desc(ocfs2_filesys *fs,
 				    struct o2cb_region_desc *desc);
 
-errcode_t ocfs2_start_heartbeat(ocfs2_filesys *fs);
-
-errcode_t ocfs2_stop_heartbeat(ocfs2_filesys *fs);
-
 errcode_t ocfs2_lock_down_cluster(ocfs2_filesys *fs);
 
 errcode_t ocfs2_release_cluster(ocfs2_filesys *fs);
 
-errcode_t ocfs2_initialize_dlm(ocfs2_filesys *fs);
+errcode_t ocfs2_initialize_dlm(ocfs2_filesys *fs, const char *service);
 
-errcode_t ocfs2_shutdown_dlm(ocfs2_filesys *fs);
+errcode_t ocfs2_shutdown_dlm(ocfs2_filesys *fs, const char *service);
 
 errcode_t ocfs2_super_lock(ocfs2_filesys *fs);
 

Modified: branches/cman-based/mkfs.ocfs2/check.c
===================================================================
--- branches/cman-based/mkfs.ocfs2/check.c	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/mkfs.ocfs2/check.c	2007-08-17 21:27:31 UTC (rev 1393)
@@ -30,6 +30,8 @@
 #include <ocfs1_fs_compat.h>
 #include <kernel-list.h>
 
+#define WHOAMI "mkfs.ocfs2"
+
 int ocfs2_check_volume(State *s)
 {
 	ocfs2_filesys *fs = NULL;
@@ -85,7 +87,7 @@
 			return -1;
 		}
 
-		ret = ocfs2_initialize_dlm(fs);
+		ret = ocfs2_initialize_dlm(fs, WHOAMI);
 		if (ret) {
 			ocfs2_close(fs);
 			com_err(s->progname, ret, "while initializing the dlm");
@@ -99,7 +101,7 @@
 
 		ret = ocfs2_lock_down_cluster(fs);
 		if (ret) {
-			ocfs2_shutdown_dlm(fs);
+			ocfs2_shutdown_dlm(fs, WHOAMI);
 			ocfs2_close(fs);
 			com_err(s->progname, ret, "while locking the cluster");
 			fprintf(stderr,
@@ -109,7 +111,7 @@
 		}
 
 		ocfs2_release_cluster(fs);
-		ocfs2_shutdown_dlm(fs);
+		ocfs2_shutdown_dlm(fs, WHOAMI);
 	} else {
 		fprintf(stderr,
 			"WARNING: Cluster check disabled.\n");

Modified: branches/cman-based/mount.ocfs2/mount.ocfs2.c
===================================================================
--- branches/cman-based/mount.ocfs2/mount.ocfs2.c	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/mount.ocfs2/mount.ocfs2.c	2007-08-17 21:27:31 UTC (rev 1393)
@@ -261,6 +261,7 @@
 	int dev_ro = 0;
 	char *hbstr = NULL;
 	ocfs2_filesys *fs = NULL;
+	struct o2cb_region_desc desc;
 	int clustered = 1;
 	int hb_started = 0;
 
@@ -306,6 +307,15 @@
 			goto bail;
 		}
 
+		ret = ocfs2_fill_heartbeat_desc(fs, &desc);
+		if (ret) {
+			com_err(progname, ret,
+				"while trying to determine heartbeat information");
+			goto bail;
+		}
+		desc.r_persist = 1;
+		desc.r_service = mo.dir;
+
 		ret = o2cb_get_hb_ctl_path(hb_ctl_path, sizeof(hb_ctl_path));
 		if (ret) {
 			com_err(progname, ret,
@@ -325,7 +335,7 @@
 	block_signals (SIG_BLOCK);
 
 	if (!(mo.flags & MS_REMOUNT) && !dev_ro && clustered) {
-		ret = ocfs2_start_heartbeat(fs);
+		ret = o2cb_begin_group_join(NULL, &desc);
 		if (ret) {
 			block_signals (SIG_UNBLOCK);
 			com_err(progname, ret,
@@ -350,14 +360,31 @@
 	ret = mount(mo.dev, mo.dir, OCFS2_FS_NAME, mo.flags & ~MS_NOSYS, extra);
 	if (ret) {
 		ret = errno;
-		if (hb_started)
-			ocfs2_stop_heartbeat(fs);
+		if (hb_started) {
+			/* We ignore the return code because the mount
+			 * failure is the important error.
+			 * complete_group_join() will handle cleaning up */
+			o2cb_complete_group_join(NULL, &desc, errno);
+		}
 		block_signals (SIG_UNBLOCK);
 		com_err(progname, ret, "while mounting %s on %s. "
 			"Check 'dmesg' for more information on this error.",
 			mo.dev, mo.dir);
 		goto bail;
 	}
+	if (hb_started) {
+		ret = o2cb_complete_group_join(NULL, &desc, 0);
+		if (ret) {
+			com_err(progname, ret,
+				"while completing heartbeat startup (WARNING)");
+			/*
+			 * XXX: GFS2 allows the mount to continue, so we
+			 * will do the same.  I don't know how clean that
+			 * is, but I don't have a better solution.
+			 */
+			ret = 0;
+		}
+	}
 
 	run_hb_ctl (hb_ctl_path, mo.dev, "-P");
 	update_mtab_entry(mo.dev, mo.dir, OCFS2_FS_NAME,

Modified: branches/cman-based/mount.ocfs2/umount.ocfs2.c
===================================================================
--- branches/cman-based/mount.ocfs2/umount.ocfs2.c	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/mount.ocfs2/umount.ocfs2.c	2007-08-17 21:27:31 UTC (rev 1393)
@@ -143,6 +143,7 @@
 	errcode_t ret = 0;
 	struct mount_options mo;
 	ocfs2_filesys *fs = NULL;
+	struct o2cb_region_desc desc;
 	int clustered = 1;
 
 	initialize_ocfs_error_table();
@@ -178,7 +179,7 @@
 	clustered = (0 == ocfs2_mount_local(fs));
 
 	if (verbose)
-		printf("device=%s\n", mo.dev);
+		printf("dir=%s device=%s\n", mo.dir, mo.dev);
 
 	if (clustered) {
 		ret = o2cb_init();
@@ -186,6 +187,15 @@
 			com_err(progname, ret, "Cannot initialize cluster");
 			goto bail;
 		}
+
+		ret = ocfs2_fill_heartbeat_desc(fs, &desc);
+		if (ret) {
+			com_err(progname, ret,
+				"while loading heartbeat information");
+			goto bail;
+		}
+		desc.r_persist = 1;
+		desc.r_service = mo.dir;
 	}
 
 	block_signals (SIG_BLOCK);
@@ -214,7 +224,13 @@
 	if (rc)
 		goto unblock;
 
-	ocfs2_stop_heartbeat(fs);
+	ret = o2cb_group_leave(NULL, &desc);
+	if (ret) {
+		com_err(progname, ret,
+			"while stopping heartbeat (WARNING)");
+		/* Don't propagate the error, just warn */
+		ret = 0;
+	}
 
 	if (!nomtab)
 		update_mtab(mo.dir, NULL);

Modified: branches/cman-based/ocfs2_hb_ctl/ocfs2_hb_ctl.c
===================================================================
--- branches/cman-based/ocfs2_hb_ctl/ocfs2_hb_ctl.c	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/ocfs2_hb_ctl/ocfs2_hb_ctl.c	2007-08-17 21:27:31 UTC (rev 1393)
@@ -63,6 +63,14 @@
 	char *dev_str;
 	char *uuid_str;
 	int  io_prio;
+	char *service;  /* The service accessing the region.  Ths is
+			   usually the mountpoint, but could be a program
+			   name like 'fsck.ocfs2'. Note that the service
+			   is now a required argument to this program.
+			   This will work even with old kernels, because
+			   o2cb.init fills the hb_ctl path with /bin/true.
+			   Nothing in ocfs2-tools will call this
+			   incorrectly. */
 };
 
 
@@ -286,8 +294,18 @@
 	if (!hbo->dev_str)
 		err = lookup_dev(hbo);
 	if (!err) {
-		err = o2cb_start_heartbeat_region_perm(NULL,
-						       region_desc);
+		region_desc->r_persist = 1;  /* hb_ctl is for reals */
+		region_desc->r_service = hbo->service;
+		err = o2cb_begin_group_join(NULL, region_desc);
+		if (!err) {
+			/*
+			 * This is a manual start, there is no service
+			 * or mountpoint being started by hb_ctl, so
+			 * we assume success
+			 */
+			err = o2cb_complete_group_join(NULL, region_desc,
+						       0);
+		}
 	}
 
 	return err;
@@ -329,9 +347,15 @@
 
 static errcode_t stop_heartbeat(struct hb_ctl_options *hbo)
 {
-	errcode_t err;
+	errcode_t err = 0;
 
-	err = o2cb_stop_heartbeat_region_perm(NULL, hbo->uuid_str);
+	if (!hbo->dev_str)
+		err = lookup_dev(hbo);
+	if (!err) {
+		region_desc->r_persist = 1;  /* hb_ctl is for reals */
+		region_desc->r_service = hbo->service;
+		err = o2cb_group_leave(NULL, region_desc);
+	}
 
 	return err;
 }
@@ -402,6 +426,9 @@
 			break;
 		}
 	}
+	
+	if (!ret && (optind < argc))
+		hbo->service = strdup(argv[optind]);
 
 	return ret;
 }
@@ -414,14 +441,16 @@
 	case HB_ACTION_START:
 		/* For start must specify exactly one of uuid or device. */
 		if ((hbo->uuid_str && hbo->dev_str) ||
-		    (!hbo->uuid_str && !hbo->dev_str))
+		    (!hbo->uuid_str && !hbo->dev_str) ||
+		    !hbo->service)
 			ret = -EINVAL;
 		break;
 
 	case HB_ACTION_STOP:
 		/* For stop must specify exactly one of uuid or device. */
 		if ((hbo->uuid_str && hbo->dev_str) ||
-		    (!hbo->uuid_str && !hbo->dev_str))
+		    (!hbo->uuid_str && !hbo->dev_str) ||
+		    !hbo->service)
 			ret = -EINVAL;
 		break;
 
@@ -456,10 +485,10 @@
 {
 	FILE *output = err ? stderr : stdout;
 
-	fprintf(output, "Usage: %s -S -d <device>\n", progname);
-	fprintf(output, "       %s -S -u <uuid>\n", progname);
-	fprintf(output, "       %s -K -d <device>\n", progname);
-	fprintf(output, "       %s -K -u <uuid>\n", progname);
+	fprintf(output, "Usage: %s -S -d <device> <service>\n", progname);
+	fprintf(output, "       %s -S -u <uuid> <service>\n", progname);
+	fprintf(output, "       %s -K -d <device> <service>\n", progname);
+	fprintf(output, "       %s -K -u <uuid> <service>\n", progname);
 	fprintf(output, "       %s -I -d <device>\n", progname);
 	fprintf(output, "       %s -I -u <uuid>\n", progname);
 	fprintf(output, "       %s -P -d <device> [-n <io_priority>]\n", progname);
@@ -471,7 +500,9 @@
 {
 	errcode_t err = 0;
 	int ret = 0;
-	struct hb_ctl_options hbo = { HB_ACTION_UNKNOWN, NULL, NULL, 0 };
+	struct hb_ctl_options hbo = {
+		.action = HB_ACTION_UNKNOWN,
+	};
 	char hbuuid[33];
 
 	setbuf(stdout, NULL);

Modified: branches/cman-based/tunefs.ocfs2/tunefs.c
===================================================================
--- branches/cman-based/tunefs.ocfs2/tunefs.c	2007-08-17 01:19:10 UTC (rev 1392)
+++ branches/cman-based/tunefs.ocfs2/tunefs.c	2007-08-17 21:27:31 UTC (rev 1393)
@@ -25,6 +25,8 @@
 
 #include <tunefs.h>
 
+#define WHOAMI "tunefs.ocfs2"
+
 ocfs2_tune_opts opts;
 ocfs2_filesys *fs_gbl = NULL;
 static int cluster_locked = 0;
@@ -55,7 +57,7 @@
 			ocfs2_release_cluster(fs_gbl);
 
 		if (fs_gbl && fs_gbl->fs_dlm_ctxt)
-			ocfs2_shutdown_dlm(fs_gbl);
+			ocfs2_shutdown_dlm(fs_gbl, WHOAMI);
 
 		exit(1);
 	}
@@ -1311,7 +1313,7 @@
 			exit(1);
 		}
 
-		ret = ocfs2_initialize_dlm(fs);
+		ret = ocfs2_initialize_dlm(fs, WHOAMI);
 		if (ret) {
 			com_err(opts.progname, ret, "while initializing the dlm");
 			goto close;
@@ -1576,7 +1578,7 @@
 close:
 	block_signals(SIG_BLOCK);
 	if (fs && fs->fs_dlm_ctxt)
-		ocfs2_shutdown_dlm(fs);
+		ocfs2_shutdown_dlm(fs, WHOAMI);
 	block_signals(SIG_UNBLOCK);
 
 	free_opts();




More information about the Ocfs2-tools-commits mailing list