svn commit: samba r24275 - in branches/SAMBA_4_0/source/cluster/ctdb: .

tridge at samba.org tridge at samba.org
Wed Aug 8 03:19:38 GMT 2007


Author: tridge
Date: 2007-08-08 03:19:38 +0000 (Wed, 08 Aug 2007)
New Revision: 24275

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=24275

Log:

- setup the connection to the ctdb daemon

- disable the brlock ctdb backend for now

Modified:
   branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c


Changeset:
Modified: branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c
===================================================================
--- branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c	2007-08-08 03:18:51 UTC (rev 24274)
+++ branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c	2007-08-08 03:19:38 UTC (rev 24275)
@@ -42,6 +42,7 @@
 struct cluster_state {
 	struct ctdb_context *ctdb;
 	struct cluster_messaging_list *list;
+	uint32_t vnn;
 };
 
 
@@ -197,6 +198,7 @@
 void cluster_ctdb_init(struct event_context *ev, const char *model)
 {
 	struct cluster_state *state;
+	int ret;
 
 	if (!lp_parm_bool(-1, "ctdb", "enable", False)) {
 		return;
@@ -208,17 +210,32 @@
 	state->ctdb = ctdb_init(ev);
 	if (state->ctdb == NULL) goto failed;
 
+	ret = ctdb_socket_connect(state->ctdb);
+	if (ret == -1) {
+		DEBUG(0,(__location__ " Failed to connect to ctdb socket\n"));
+		goto failed;
+	}
+
+	/* get our vnn */
+	state->vnn = ctdb_ctrl_getvnn(state->ctdb, timeval_zero(), CTDB_CURRENT_NODE);
+	if (state->vnn == (uint32_t)-1) {
+		DEBUG(0,(__location__ " Failed to get ctdb vnn\n"));
+		goto failed;
+	}
+
 	state->list = NULL;
 
 	cluster_ctdb_ops.private = state;
 
 	cluster_set_ops(&cluster_ctdb_ops);
 
+#if 0
 	/* nasty hack for now ... */
 	{
 		void brl_ctdb_init_ops(void);
 		brl_ctdb_init_ops();
 	}
+#endif
 
 	return;
 	



More information about the samba-cvs mailing list