[SCM] CTDB repository - branch libctdb updated - ctdb-1.0.114-86-g8552ef6

Ronnie Sahlberg sahlberg at samba.org
Tue May 11 12:54:42 MDT 2010


The branch, libctdb has been updated
       via  8552ef6c62b77fd333ff8b15f6ff82011dfbd54f (commit)
      from  6cd409926803bed1a3a611347ef4e9ddaa8c4d86 (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=libctdb


- Log -----------------------------------------------------------------
commit 8552ef6c62b77fd333ff8b15f6ff82011dfbd54f
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Wed May 12 04:53:44 2010 +1000

    move messaging functions into libctdb

-----------------------------------------------------------------------

Summary of changes:
 client/ctdb_client.c    |   43 -------------------------------------------
 include/ctdb.h          |   15 +++++++++++++++
 include/ctdb_protocol.h |   11 -----------
 3 files changed, 15 insertions(+), 54 deletions(-)


Changeset truncated at 500 lines:

diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index 1afa66a..f8e98b5 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -95,49 +95,6 @@ int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call)
 }
 
 
-/*
-  tell the daemon what messaging srvid we will use, and register the message
-  handler function in the client
-*/
-int ctdb_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid, 
-			     ctdb_message_fn_t handler,
-			     void *private_data)
-				    
-{
-	int res;
-	int32_t status;
-	
-	res = ctdb_control(ctdb, CTDB_CURRENT_NODE, srvid, CTDB_CONTROL_REGISTER_SRVID, 0, 
-			   tdb_null, NULL, NULL, &status, NULL, NULL);
-	if (res != 0 || status != 0) {
-		DEBUG(DEBUG_ERR,("Failed to register srvid %llu\n", (unsigned long long)srvid));
-		return -1;
-	}
-
-	/* also need to register the handler with our own ctdb structure */
-	return ctdb_register_message_handler(ctdb, ctdb, srvid, handler, private_data);
-}
-
-/*
-  tell the daemon we no longer want a srvid
-*/
-int ctdb_remove_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void *private_data)
-{
-	int res;
-	int32_t status;
-	
-	res = ctdb_control(ctdb, CTDB_CURRENT_NODE, srvid, CTDB_CONTROL_DEREGISTER_SRVID, 0, 
-			   tdb_null, NULL, NULL, &status, NULL, NULL);
-	if (res != 0 || status != 0) {
-		DEBUG(DEBUG_ERR,("Failed to deregister srvid %llu\n", (unsigned long long)srvid));
-		return -1;
-	}
-
-	/* also need to register the handler with our own ctdb structure */
-	ctdb_deregister_message_handler(ctdb, srvid, private_data);
-	return 0;
-}
-
 
 
 
diff --git a/include/ctdb.h b/include/ctdb.h
index dd5361c..df9f54c 100644
--- a/include/ctdb.h
+++ b/include/ctdb.h
@@ -39,6 +39,21 @@ typedef void ctdb_handle;
 int ctdb_cancel(ctdb_handle *);
 
 
+
+/*
+ * messaging functions 
+ */
+typedef void (*ctdb_message_fn_t)(struct ctdb_context *, uint64_t srvid, TDB_DATA data, void *);
+
+int ctdb_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid, ctdb_message_fn_t handler, void *private_data);
+
+int ctdb_remove_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void *private_data);
+
+int ctdb_send_message(struct ctdb_context *ctdb, uint32_t pnn, uint64_t srvid, TDB_DATA data);
+
+
+
+
 /*
  * functions to read the recovery master of a node
  */
diff --git a/include/ctdb_protocol.h b/include/ctdb_protocol.h
index cf4305f..e1d2e4e 100644
--- a/include/ctdb_protocol.h
+++ b/include/ctdb_protocol.h
@@ -266,22 +266,11 @@ uint32_t ctdb_get_pnn(struct ctdb_context *ctdb);
 */
 uint32_t ctdb_get_num_nodes(struct ctdb_context *ctdb);
 
-/* setup a handler for ctdb messages */
-typedef void (*ctdb_message_fn_t)(struct ctdb_context *, uint64_t srvid, 
-				  TDB_DATA data, void *);
-int ctdb_set_message_handler(struct ctdb_context *ctdb, uint64_t srvid, 
-			     ctdb_message_fn_t handler,
-			     void *private_data);
-
 
 int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call);
 struct ctdb_client_call_state *ctdb_call_send(struct ctdb_db_context *ctdb_db, struct ctdb_call *call);
 int ctdb_call_recv(struct ctdb_client_call_state *state, struct ctdb_call *call);
 
-/* send a ctdb message */
-int ctdb_send_message(struct ctdb_context *ctdb, uint32_t pnn,
-		      uint64_t srvid, TDB_DATA data);
-
 
 /* 
    Fetch a ctdb record from a remote node


-- 
CTDB repository


More information about the samba-cvs mailing list