This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

master - cman: add /libccs/@next_handle support


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=104b07997f30a4eb6a126068a3651193abd893cc
Commit:        104b07997f30a4eb6a126068a3651193abd893cc
Parent:        d029acbadfbb3dc3170d30b00c317bf7e7616f1d
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Tue Oct 28 14:04:35 2008 +0100
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Tue Oct 28 20:29:03 2008 +0100

cman: add /libccs/@next_handle support

next_handle will be atomically incremented by corosync to return
ccs_handle down the pipe.

We create it in cman-preconfig to avoid an "init" race in libccs.

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 cman/daemon/cman-preconfig.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index 2f4ffaa..df647ec 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -1044,6 +1044,23 @@ static int cmanpre_readconfig(struct objdb_iface_ver0 *objdb, char **error_strin
         }
 	objdb->object_find_destroy(find_handle);
 
+	/* This will create /libccs/@next_handle.
+	 * next_handle will be atomically incremented by corosync to return ccs_handle down the pipe.
+	 * We create it in cman-preconfig to avoid an "init" race in libccs.
+	 */
+
+	objdb->object_find_create(OBJECT_PARENT_HANDLE, "libccs", strlen("libccs"), &find_handle);
+	if (objdb->object_find_next(find_handle, &object_handle)) {
+		int next_handle = 0;
+
+		objdb->object_create(OBJECT_PARENT_HANDLE, &object_handle,
+					"libccs", strlen("libccs"));
+
+		objdb->object_key_create(object_handle, "next_handle", strlen("next_handle"),
+					 &next_handle, sizeof(int));
+	}
+	objdb->object_find_destroy(find_handle);
+
 	get_env_overrides();
 	if (getenv("CMAN_NOCONFIG"))
 		ret = set_noccs_defaults(objdb);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]