Explorar el Código

Unification around hdb_handle_t data type.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1782 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake hace 17 años
padre
commit
58ab8d4a65

+ 4 - 4
exec/apidef.c

@@ -56,10 +56,10 @@ LOGSYS_DECLARE_SUBSYS ("APIDEF", LOG_INFO);
 /*
 /*
  * Remove compile warnings about type name changes
  * Remove compile warnings about type name changes
  */
  */
-typedef int (*typedef_tpg_join) (cs_tpg_handle, struct corosync_tpg_group *, int);
-typedef int (*typedef_tpg_leave) (cs_tpg_handle, struct corosync_tpg_group *, int);
-typedef int (*typedef_tpg_groups_mcast) (cs_tpg_handle, int, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
-typedef int (*typedef_tpg_groups_send_ok) (cs_tpg_handle, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
+typedef int (*typedef_tpg_join) (hdb_handle_t, struct corosync_tpg_group *, int);
+typedef int (*typedef_tpg_leave) (hdb_handle_t, struct corosync_tpg_group *, int);
+typedef int (*typedef_tpg_groups_mcast) (hdb_handle_t, int, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
+typedef int (*typedef_tpg_groups_send_ok) (hdb_handle_t, struct corosync_tpg_group *, int groups_cnt, struct iovec *, int);
 
 
 static inline void _corosync_public_exit_error (
 static inline void _corosync_public_exit_error (
 	cs_fatal_error_t err, const char *file, unsigned int line)
 	cs_fatal_error_t err, const char *file, unsigned int line)

+ 2 - 2
exec/coroparse.c

@@ -83,7 +83,7 @@ static char *remove_whitespace(char *string)
 
 
 static int parse_section(FILE *fp,
 static int parse_section(FILE *fp,
 			 struct objdb_iface_ver0 *objdb,
 			 struct objdb_iface_ver0 *objdb,
-			 unsigned int parent_handle,
+			 hdb_handle_t parent_handle,
 			 char **error_string)
 			 char **error_string)
 {
 {
 	char line[512];
 	char line[512];
@@ -111,7 +111,7 @@ static int parse_section(FILE *fp,
 
 
 		/* New section ? */
 		/* New section ? */
 		if ((loc = strstr_rs (line, "{"))) {
 		if ((loc = strstr_rs (line, "{"))) {
-			unsigned int new_parent;
+			hdb_handle_t new_parent;
 			char *section = remove_whitespace(line);
 			char *section = remove_whitespace(line);
 
 
 			loc--;
 			loc--;

+ 15 - 15
exec/coropoll.c

@@ -39,12 +39,12 @@
 #include <string.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdio.h>
 
 
+#include <corosync/hdb.h>
 #include <corosync/totem/coropoll.h>
 #include <corosync/totem/coropoll.h>
 #include <corosync/list.h>
 #include <corosync/list.h>
-#include <corosync/hdb.h>
 #include "tlist.h"
 #include "tlist.h"
 
 
-typedef int (*dispatch_fn_t) (poll_handle poll_handle, int fd, int revents, void *data);
+typedef int (*dispatch_fn_t) (hdb_handle_t hdb_handle_t, int fd, int revents, void *data);
 
 
 struct poll_entry {
 struct poll_entry {
 	struct pollfd ufd;
 	struct pollfd ufd;
@@ -71,11 +71,11 @@ static struct hdb_handle_database poll_instance_database = {
 	.iterator	= 0
 	.iterator	= 0
 };
 };
 
 
-poll_handle poll_create (
+hdb_handle_t poll_create (
 	void (*serialize_lock_fn) (void),
 	void (*serialize_lock_fn) (void),
 	void (*serialize_unlock_fn) (void))
 	void (*serialize_unlock_fn) (void))
 {
 {
-	poll_handle handle;
+	hdb_handle_t handle;
 	struct poll_instance *poll_instance;
 	struct poll_instance *poll_instance;
 	unsigned int res;
 	unsigned int res;
 
 
@@ -107,7 +107,7 @@ error_exit:
 	return (-1);
 	return (-1);
 }
 }
 
 
-int poll_destroy (poll_handle handle)
+int poll_destroy (hdb_handle_t handle)
 {
 {
 	struct poll_instance *poll_instance;
 	struct poll_instance *poll_instance;
 	int res = 0;
 	int res = 0;
@@ -135,12 +135,12 @@ error_exit:
 }
 }
 
 
 int poll_dispatch_add (
 int poll_dispatch_add (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int fd,
 	int fd,
 	int events,
 	int events,
 	void *data,
 	void *data,
 	int (*dispatch_fn) (
 	int (*dispatch_fn) (
-		poll_handle poll_handle,
+		hdb_handle_t hdb_handle_t,
 		int fd,
 		int fd,
 		int revents,
 		int revents,
 		void *data))
 		void *data))
@@ -209,11 +209,11 @@ error_exit:
 }
 }
 
 
 int poll_dispatch_modify (
 int poll_dispatch_modify (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int fd,
 	int fd,
 	int events,
 	int events,
 	int (*dispatch_fn) (
 	int (*dispatch_fn) (
-		poll_handle poll_handle,
+		hdb_handle_t hdb_handle_t,
 		int fd,
 		int fd,
 		int revents,
 		int revents,
 		void *data))
 		void *data))
@@ -251,7 +251,7 @@ error_exit:
 }
 }
 
 
 int poll_dispatch_delete (
 int poll_dispatch_delete (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int fd)
 	int fd)
 {
 {
 	struct poll_instance *poll_instance;
 	struct poll_instance *poll_instance;
@@ -285,7 +285,7 @@ error_exit:
 }
 }
 
 
 int poll_timer_add (
 int poll_timer_add (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int msec_duration, void *data,
 	int msec_duration, void *data,
 	void (*timer_fn) (void *data),
 	void (*timer_fn) (void *data),
 	poll_timer_handle *timer_handle_out)
 	poll_timer_handle *timer_handle_out)
@@ -314,7 +314,7 @@ error_exit:
 }
 }
 
 
 int poll_timer_delete (
 int poll_timer_delete (
-	poll_handle handle,
+	hdb_handle_t handle,
 	poll_timer_handle timer_handle)
 	poll_timer_handle timer_handle)
 {
 {
 	struct poll_instance *poll_instance;
 	struct poll_instance *poll_instance;
@@ -339,7 +339,7 @@ error_exit:
 }
 }
 
 
 int poll_stop (
 int poll_stop (
-	poll_handle handle)
+	hdb_handle_t handle)
 {
 {
 	struct poll_instance *poll_instance;
 	struct poll_instance *poll_instance;
 	unsigned int res;
 	unsigned int res;
@@ -360,7 +360,7 @@ error_exit:
 
 
 
 
 int poll_run (
 int poll_run (
-	poll_handle handle)
+	hdb_handle_t handle)
 {
 {
 	struct poll_instance *poll_instance;
 	struct poll_instance *poll_instance;
 	int i;
 	int i;
@@ -432,7 +432,7 @@ error_exit:
 
 
 #ifdef COMPILE_OUT
 #ifdef COMPILE_OUT
 void poll_print_state (
 void poll_print_state (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int fd)
 	int fd)
 {
 {
 	struct poll_instance *poll_instance;
 	struct poll_instance *poll_instance;

+ 8 - 8
exec/ipc.c

@@ -435,7 +435,7 @@ static int poll_handler_connection_destroy(
 }
 }
 
 
 static int poll_handler_connection (
 static int poll_handler_connection (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int fd,
 	int fd,
 	int revent,
 	int revent,
 	void *data)
 	void *data)
@@ -577,7 +577,7 @@ static int poll_handler_connection (
 		if (conn_info->notify_flow_control_enabled == 0 &&
 		if (conn_info->notify_flow_control_enabled == 0 &&
 			conn_info->pending_semops == 0) {
 			conn_info->pending_semops == 0) {
 
 
-			poll_dispatch_modify (aisexec_poll_handle,
+			poll_dispatch_modify (corosync_poll_handle,
 				conn_info->fd, POLLIN|POLLNVAL,
 				conn_info->fd, POLLIN|POLLNVAL,
 				poll_handler_connection);
 				poll_handler_connection);
 		}
 		}
@@ -592,7 +592,7 @@ static void ipc_disconnect (struct conn_info *conn_info)
 	conn_info->disconnect_requested = 1;
 	conn_info->disconnect_requested = 1;
 	pthread_mutex_unlock (&conn_info->mutex);
 	pthread_mutex_unlock (&conn_info->mutex);
 
 
-	poll_dispatch_modify (aisexec_poll_handle,
+	poll_dispatch_modify (corosync_poll_handle,
 		conn_info->fd, POLLOUT|POLLNVAL,
 		conn_info->fd, POLLOUT|POLLNVAL,
 		poll_handler_connection);
 		poll_handler_connection);
 }
 }
@@ -613,7 +613,7 @@ static int conn_info_create (int fd)
 	list_init (&conn_info->list);
 	list_init (&conn_info->list);
 	list_add (&conn_info->list, &conn_info_list_head);
 	list_add (&conn_info->list, &conn_info_list_head);
 
 
-        poll_dispatch_add (aisexec_poll_handle, fd, POLLIN|POLLNVAL,
+        poll_dispatch_add (corosync_poll_handle, fd, POLLIN|POLLNVAL,
 		conn_info, poll_handler_connection);
 		conn_info, poll_handler_connection);
 	return (0);
 	return (0);
 }
 }
@@ -633,7 +633,7 @@ char *socketname = "/var/run/libais.socket";
 #endif
 #endif
 
 
 static int poll_handler_accept (
 static int poll_handler_accept (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int fd,
 	int fd,
 	int revent,
 	int revent,
 	void *data)
 	void *data)
@@ -759,7 +759,7 @@ extern void cs_ipc_init (
         /*
         /*
          * Setup libais connection dispatch routine
          * Setup libais connection dispatch routine
          */
          */
-        poll_dispatch_add (aisexec_poll_handle, libais_server_fd,
+        poll_dispatch_add (corosync_poll_handle, libais_server_fd,
                 POLLIN|POLLNVAL, 0, poll_handler_accept);
                 POLLIN|POLLNVAL, 0, poll_handler_accept);
 
 
 	g_gid_valid = gid_valid;
 	g_gid_valid = gid_valid;
@@ -904,7 +904,7 @@ void msg_send (void *conn, struct iovec *iov, int iov_len, int locked)
 		if (locked == 0) {
 		if (locked == 0) {
 			pthread_mutex_unlock (&conn_info->mutex);
 			pthread_mutex_unlock (&conn_info->mutex);
 		}
 		}
-        	poll_dispatch_modify (aisexec_poll_handle, conn_info->fd,
+        	poll_dispatch_modify (corosync_poll_handle, conn_info->fd,
 			POLLIN|POLLOUT|POLLNVAL, poll_handler_connection);
 			POLLIN|POLLOUT|POLLNVAL, poll_handler_connection);
 	} else
 	} else
 	if (res == -1) {
 	if (res == -1) {
@@ -1046,7 +1046,7 @@ static void msg_send_or_queue (void *conn, struct iovec *iov, int iov_len)
 		pthread_mutex_lock (&conn_info->mutex);
 		pthread_mutex_lock (&conn_info->mutex);
 		if (list_empty (&conn_info->outq_head)) {
 		if (list_empty (&conn_info->outq_head)) {
 			conn_info->notify_flow_control_enabled = 1;
 			conn_info->notify_flow_control_enabled = 1;
-			poll_dispatch_modify (aisexec_poll_handle,
+			poll_dispatch_modify (corosync_poll_handle,
 				conn_info->fd, POLLOUT|POLLIN|POLLNVAL,
 				conn_info->fd, POLLOUT|POLLIN|POLLNVAL,
 				poll_handler_connection);
 				poll_handler_connection);
 		}
 		}

+ 24 - 22
exec/main.c

@@ -108,6 +108,8 @@ static struct corosync_api_v1 *api = NULL;
 
 
 unsigned long long *(*main_clm_get_by_nodeid) (unsigned int node_id);
 unsigned long long *(*main_clm_get_by_nodeid) (unsigned int node_id);
 
 
+hdb_handle_t corosync_poll_handle;
+
 static void sigusr2_handler (int num)
 static void sigusr2_handler (int num)
 {
 {
 	int i;
 	int i;
@@ -119,7 +121,7 @@ static void sigusr2_handler (int num)
 	}
 	}
 }
 }
 
 
-static void *aisexec_exit (void *arg)
+static void *corosync_exit (void *arg)
 {
 {
 	if (api) {
 	if (api) {
 		corosync_service_unlink_all (api);
 		corosync_service_unlink_all (api);
@@ -148,10 +150,10 @@ static void *aisexec_exit (void *arg)
 	return NULL;
 	return NULL;
 }
 }
 
 
-pthread_t aisexec_exit_thread;
+pthread_t corosync_exit_thread;
 static void init_shutdown(void *data) 
 static void init_shutdown(void *data) 
 {
 {
-	pthread_create (&aisexec_exit_thread, NULL, aisexec_exit, NULL);
+	pthread_create (&corosync_exit_thread, NULL, corosync_exit, NULL);
 }
 }
 
 
 
 
@@ -159,7 +161,7 @@ static poll_timer_handle shutdown_handle;
 static void sigquit_handler (int num)
 static void sigquit_handler (int num)
 {
 {
 	/* avoid creating threads from within the interrupt context */
 	/* avoid creating threads from within the interrupt context */
-	poll_timer_add (aisexec_poll_handle, 500, NULL, init_shutdown, &shutdown_handle);
+	poll_timer_add (corosync_poll_handle, 500, NULL, init_shutdown, &shutdown_handle);
 }
 }
 
 
 
 
@@ -181,7 +183,7 @@ static void sigabrt_handler (int num)
 
 
 #define LOCALHOST_IP inet_addr("127.0.0.1")
 #define LOCALHOST_IP inet_addr("127.0.0.1")
 
 
-totempg_groups_handle corosync_group_handle;
+hdb_handle_t corosync_group_handle;
 
 
 struct totempg_group corosync_group = {
 struct totempg_group corosync_group = {
 	.group		= "a",
 	.group		= "a",
@@ -190,7 +192,7 @@ struct totempg_group corosync_group = {
 
 
 void sigintr_handler (int signum)
 void sigintr_handler (int signum)
 {
 {
-	poll_timer_add (aisexec_poll_handle, 500, NULL, init_shutdown, &shutdown_handle);
+	poll_timer_add (corosync_poll_handle, 500, NULL, init_shutdown, &shutdown_handle);
 }
 }
 
 
 
 
@@ -242,7 +244,7 @@ static int corosync_sync_callbacks_retrieve (int sync_id,
 	return (0);
 	return (0);
 }
 }
 
 
-static struct memb_ring_id aisexec_ring_id;
+static struct memb_ring_id corosync_ring_id;
 
 
 static void confchg_fn (
 static void confchg_fn (
 	enum totem_configuration_type configuration_type,
 	enum totem_configuration_type configuration_type,
@@ -253,7 +255,7 @@ static void confchg_fn (
 {
 {
 	int i;
 	int i;
 
 
-	memcpy (&aisexec_ring_id, ring_id, sizeof (struct memb_ring_id));
+	memcpy (&corosync_ring_id, ring_id, sizeof (struct memb_ring_id));
 
 
 	/*
 	/*
 	 * Call configuration change for all services
 	 * Call configuration change for all services
@@ -275,7 +277,7 @@ return; /* TODO: we are still not dropping privs */
 	setegid (main_config->gid);
 	setegid (main_config->gid);
 }
 }
 
 
-static void aisexec_mempool_init (void)
+static void corosync_mempool_init (void)
 {
 {
 	int res;
 	int res;
 
 
@@ -286,7 +288,7 @@ static void aisexec_mempool_init (void)
 	}
 	}
 }
 }
 
 
-static void aisexec_tty_detach (void)
+static void corosync_tty_detach (void)
 {
 {
 	int fd;
 	int fd;
 
 
@@ -332,7 +334,7 @@ static void aisexec_tty_detach (void)
 	}
 	}
 }
 }
 
 
-static void aisexec_setscheduler (void)
+static void corosync_setscheduler (void)
 {
 {
 #if ! defined(TS_CLASS) && (defined(COROSYNC_BSD) || defined(COROSYNC_LINUX) || defined(COROSYNC_SOLARIS))
 #if ! defined(TS_CLASS) && (defined(COROSYNC_BSD) || defined(COROSYNC_LINUX) || defined(COROSYNC_SOLARIS))
 	struct sched_param sched_param;
 	struct sched_param sched_param;
@@ -353,7 +355,7 @@ static void aisexec_setscheduler (void)
 #endif
 #endif
 }
 }
 
 
-static void aisexec_mlockall (void)
+static void corosync_mlockall (void)
 {
 {
 #if !defined(COROSYNC_BSD)
 #if !defined(COROSYNC_BSD)
 	int res;
 	int res;
@@ -458,8 +460,8 @@ int main (int argc, char **argv)
 	char *error_string;
 	char *error_string;
 	struct main_config main_config;
 	struct main_config main_config;
 	struct totem_config totem_config;
 	struct totem_config totem_config;
-	unsigned int objdb_handle;
-	unsigned int config_handle;
+	hdb_handle_t objdb_handle;
+	hdb_handle_t config_handle;
 	unsigned int config_version = 0;
 	unsigned int config_version = 0;
 	void *objdb_p;
 	void *objdb_p;
 	struct config_iface_ver0 *config;
 	struct config_iface_ver0 *config;
@@ -494,7 +496,7 @@ int main (int argc, char **argv)
 	}	
 	}	
 
 
 	if (background)
 	if (background)
-		aisexec_tty_detach ();
+		corosync_tty_detach ();
 
 
 	log_printf (LOG_LEVEL_NOTICE, "Corosync Executive Service RELEASE '%s'\n", RELEASE_VERSION);
 	log_printf (LOG_LEVEL_NOTICE, "Corosync Executive Service RELEASE '%s'\n", RELEASE_VERSION);
 	log_printf (LOG_LEVEL_NOTICE, "Copyright (C) 2002-2006 MontaVista Software, Inc and contributors.\n");
 	log_printf (LOG_LEVEL_NOTICE, "Copyright (C) 2002-2006 MontaVista Software, Inc and contributors.\n");
@@ -512,7 +514,7 @@ int main (int argc, char **argv)
 
 
 	log_printf (LOG_LEVEL_NOTICE, "Corosync Executive Service: started and ready to provide service.\n");
 	log_printf (LOG_LEVEL_NOTICE, "Corosync Executive Service: started and ready to provide service.\n");
 
 
-	aisexec_poll_handle = poll_create (
+	corosync_poll_handle = poll_create (
 		serialize_mutex_lock,
 		serialize_mutex_lock,
 		serialize_mutex_unlock);
 		serialize_mutex_unlock);
 
 
@@ -614,9 +616,9 @@ int main (int argc, char **argv)
 	 * application healthchecking
 	 * application healthchecking
 	 */
 	 */
 	if (setprio)
 	if (setprio)
-		aisexec_setscheduler ();
+		corosync_setscheduler ();
 
 
-	aisexec_mlockall ();
+	corosync_mlockall ();
 
 
 	totem_config.totem_logging_configuration = totem_logging_configuration;
 	totem_config.totem_logging_configuration = totem_logging_configuration;
 	totem_config.totem_logging_configuration.log_subsys_id =
 	totem_config.totem_logging_configuration.log_subsys_id =
@@ -631,7 +633,7 @@ int main (int argc, char **argv)
 	/*
 	/*
 	 * Sleep for a while to let other nodes in the cluster
 	 * Sleep for a while to let other nodes in the cluster
 	 * understand that this node has been away (if it was
 	 * understand that this node has been away (if it was
-	 * an aisexec restart).
+	 * an corosync restart).
 	 */
 	 */
 
 
 // TODO what is this hack for?	usleep(totem_config.token_timeout * 2000);
 // TODO what is this hack for?	usleep(totem_config.token_timeout * 2000);
@@ -647,7 +649,7 @@ int main (int argc, char **argv)
 	 *  and configuration change functions
 	 *  and configuration change functions
 	 */
 	 */
 	totempg_initialize (
 	totempg_initialize (
-		aisexec_poll_handle,
+		corosync_poll_handle,
 		&totem_config);
 		&totem_config);
 
 
 	totempg_groups_initialize (
 	totempg_groups_initialize (
@@ -682,14 +684,14 @@ int main (int argc, char **argv)
 	 */
 	 */
 	priv_drop (&main_config);
 	priv_drop (&main_config);
 
 
-	aisexec_mempool_init ();
+	corosync_mempool_init ();
 
 
 	cs_ipc_init (main_config.gid);
 	cs_ipc_init (main_config.gid);
 
 
 	/*
 	/*
 	 * Start main processing loop
 	 * Start main processing loop
 	 */
 	 */
-	poll_run (aisexec_poll_handle);
+	poll_run (corosync_poll_handle);
 
 
 	return EXIT_SUCCESS;
 	return EXIT_SUCCESS;
 }
 }

+ 6 - 15
exec/main.h

@@ -32,35 +32,26 @@
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  * THE POSSIBILITY OF SUCH DAMAGE.
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
  */
-#ifndef AIS_EXEC_H_DEFINED
-#define AIS_EXEC_H_DEFINED
+#ifndef MAIN_H_DEFINED
+#define MAIN_H_DEFINED
 
 
 #define TRUE 1
 #define TRUE 1
 #define FALSE 0
 #define FALSE 0
 #include <corosync/corotypes.h>
 #include <corosync/corotypes.h>
+#include <corosync/hdb.h>
 #include <corosync/ipc_gen.h>
 #include <corosync/ipc_gen.h>
 #include <corosync/totem/coropoll.h>
 #include <corosync/totem/coropoll.h>
 #include <corosync/totem/totempg.h>
 #include <corosync/totem/totempg.h>
 #include <corosync/engine/objdb.h>
 #include <corosync/engine/objdb.h>
 #include <corosync/engine/config.h>
 #include <corosync/engine/config.h>
 
 
-/*
- * Size of the queue (entries) for I/O's to the API over socket IPC.
- */
-
-#ifndef SIZEQUEUE
-#define SIZEQUEUE 800
-#endif /* SIZEQUEUE */
-
 #define SOCKET_SERVICE_INIT 254
 #define SOCKET_SERVICE_INIT 254
 
 
-#define SIZEINB MESSAGE_SIZE_MAX
-
 extern struct totempg_group corosync_group;
 extern struct totempg_group corosync_group;
 
 
-extern totempg_groups_handle corosync_group_handle;
+extern hdb_handle_t corosync_group_handle;
 
 
-poll_handle aisexec_poll_handle;
+extern hdb_handle_t corosync_poll_handle;
 
 
 extern unsigned long long *(*main_clm_get_by_nodeid) (unsigned int node_id);
 extern unsigned long long *(*main_clm_get_by_nodeid) (unsigned int node_id);
 
 
@@ -75,4 +66,4 @@ extern int main_send_ok (
         struct iovec *iovec,
         struct iovec *iovec,
         int iov_len);
         int iov_len);
 
 
-#endif /* AIS_EXEC_H_DEFINED */
+#endif /* MAIN_H_DEFINED */

+ 9 - 8
exec/mainconfig.c

@@ -63,7 +63,7 @@ static void add_logsys_config_notification(
 /* This just makes the code below a little neater */
 /* This just makes the code below a little neater */
 static inline int objdb_get_string (
 static inline int objdb_get_string (
 	struct objdb_iface_ver0 *objdb,
 	struct objdb_iface_ver0 *objdb,
-	unsigned int object_service_handle,
+	hdb_handle_t object_service_handle,
 	char *key, char **value)
 	char *key, char **value)
 {
 {
 	int res;
 	int res;
@@ -83,7 +83,8 @@ static inline int objdb_get_string (
 }
 }
 
 
 static inline void objdb_get_int (
 static inline void objdb_get_int (
-	struct objdb_iface_ver0 *objdb, unsigned int object_service_handle,
+	struct objdb_iface_ver0 *objdb,
+	hdb_handle_t object_service_handle,
 	char *key, unsigned int *intvalue)
 	char *key, unsigned int *intvalue)
 {
 {
 	char *value = NULL;
 	char *value = NULL;
@@ -114,12 +115,12 @@ int corosync_main_config_read_logging (
 	char **error_string,
 	char **error_string,
 	struct main_config *main_config)
 	struct main_config *main_config)
 {
 {
-	unsigned int object_service_handle;
-	unsigned int object_logger_subsys_handle;
+	hdb_handle_t object_service_handle;
+	hdb_handle_t object_logger_subsys_handle;
 	char *value;
 	char *value;
 	char *error_reason = error_string_response;
 	char *error_reason = error_string_response;
-	unsigned int object_find_handle;
-	unsigned int object_find_logsys_handle;
+	hdb_handle_t object_find_handle;
+	hdb_handle_t object_find_logsys_handle;
 
 
 	objdb->object_find_create (
 	objdb->object_find_create (
 		OBJECT_PARENT_HANDLE,
 		OBJECT_PARENT_HANDLE,
@@ -316,10 +317,10 @@ int corosync_main_config_read (
 	char **error_string,
 	char **error_string,
 	struct main_config *main_config)
 	struct main_config *main_config)
 {
 {
-	unsigned int object_service_handle;
+	hdb_handle_t object_service_handle;
 	char *value;
 	char *value;
 	char *error_reason = error_string_response;
 	char *error_reason = error_string_response;
-	unsigned int object_find_handle;
+	hdb_handle_t object_find_handle;
 
 
 	memset (main_config, 0, sizeof (struct main_config));
 	memset (main_config, 0, sizeof (struct main_config));
 
 

+ 39 - 38
exec/objdb.c

@@ -53,7 +53,7 @@ struct object_key {
 };
 };
 
 
 struct object_tracker {
 struct object_tracker {
-	unsigned int object_handle;
+	hdb_handle_t object_handle;
 	void * data_pt;
 	void * data_pt;
 	object_track_depth_t depth;
 	object_track_depth_t depth;
 	object_key_change_notify_fn_t key_change_notify_fn;
 	object_key_change_notify_fn_t key_change_notify_fn;
@@ -67,8 +67,8 @@ struct object_tracker {
 struct object_instance {
 struct object_instance {
 	void *object_name;
 	void *object_name;
 	int object_name_len;
 	int object_name_len;
-	unsigned int object_handle;
-	unsigned int parent_handle;
+	hdb_handle_t object_handle;
+	hdb_handle_t parent_handle;
 	struct list_head key_head;
 	struct list_head key_head;
 	struct list_head child_head;
 	struct list_head child_head;
 	struct list_head child_list;
 	struct list_head child_list;
@@ -145,7 +145,7 @@ static void objdb_wrunlock()
 
 
 static int objdb_init (void)
 static int objdb_init (void)
 {
 {
-	unsigned int handle;
+	hdb_handle_t handle;
 	struct object_instance *instance;
 	struct object_instance *instance;
 	unsigned int res;
 	unsigned int res;
 
 
@@ -219,14 +219,15 @@ static int _object_notify_deleted_children(struct object_instance *parent_pt)
 	return 0;
 	return 0;
 }
 }
 
 
-static void object_created_notification(unsigned int object_handle,
-										unsigned int parent_object_handle,
-										void *name_pt, int name_len)
+static void object_created_notification(
+	hdb_handle_t object_handle,
+	hdb_handle_t parent_object_handle,
+	void *name_pt, int name_len)
 {
 {
 	struct list_head * list;
 	struct list_head * list;
 	struct object_instance * obj_pt;
 	struct object_instance * obj_pt;
 	struct object_tracker * tracker_pt;
 	struct object_tracker * tracker_pt;
-	unsigned int obj_handle = object_handle;
+	hdb_handle_t obj_handle = object_handle;
 	unsigned int res;
 	unsigned int res;
 
 
 	do {
 	do {
@@ -254,7 +255,7 @@ static void object_created_notification(unsigned int object_handle,
 
 
 }
 }
 
 
-static void object_pre_deletion_notification(unsigned int object_handle,
+static void object_pre_deletion_notification(hdb_handle_t object_handle,
 											 unsigned int parent_object_handle,
 											 unsigned int parent_object_handle,
 											 void *name_pt, int name_len)
 											 void *name_pt, int name_len)
 {
 {
@@ -292,7 +293,7 @@ static void object_pre_deletion_notification(unsigned int object_handle,
 
 
 }
 }
 
 
-static void object_key_changed_notification(unsigned int object_handle,
+static void object_key_changed_notification(hdb_handle_t object_handle,
 											void *name_pt,	int name_len,
 											void *name_pt,	int name_len,
 											void *value_pt, int value_len,
 											void *value_pt, int value_len,
 											object_change_type_t type)
 											object_change_type_t type)
@@ -301,7 +302,7 @@ static void object_key_changed_notification(unsigned int object_handle,
 	struct object_instance * obj_pt;
 	struct object_instance * obj_pt;
 	struct object_instance * owner_pt = NULL;
 	struct object_instance * owner_pt = NULL;
 	struct object_tracker * tracker_pt;
 	struct object_tracker * tracker_pt;
-	unsigned int obj_handle = object_handle;
+	hdb_handle_t obj_handle = object_handle;
 	unsigned int res;
 	unsigned int res;
 
 
 	do {
 	do {
@@ -359,8 +360,8 @@ static void object_reload_notification(int startstop, int flush)
  * object db create/destroy/set
  * object db create/destroy/set
  */
  */
 static int object_create (
 static int object_create (
-	unsigned int parent_object_handle,
-	unsigned int *object_handle,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t *object_handle,
 	void *object_name,
 	void *object_name,
 	unsigned int object_name_len)
 	unsigned int object_name_len)
 {
 {
@@ -461,7 +462,7 @@ error_exit:
 }
 }
 
 
 static int object_priv_set (
 static int object_priv_set (
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	void *priv)
 	void *priv)
 {
 {
 	int res;
 	int res;
@@ -487,7 +488,7 @@ error_exit:
 }
 }
 
 
 static int object_key_create (
 static int object_key_create (
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	void *key_name,
 	void *key_name,
 	int key_len,
 	int key_len,
 	void *value,
 	void *value,
@@ -620,7 +621,7 @@ static int _clear_object(struct object_instance *instance)
 }
 }
 
 
 static int object_destroy (
 static int object_destroy (
-	unsigned int object_handle)
+	hdb_handle_t object_handle)
 {
 {
 	struct object_instance *instance;
 	struct object_instance *instance;
 	unsigned int res;
 	unsigned int res;
@@ -651,7 +652,7 @@ static int object_destroy (
 }
 }
 
 
 static int object_valid_set (
 static int object_valid_set (
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	struct object_valid *object_valid_list,
 	struct object_valid *object_valid_list,
 	unsigned int object_valid_list_entries)
 	unsigned int object_valid_list_entries)
 {
 {
@@ -679,7 +680,7 @@ error_exit:
 }
 }
 
 
 static int object_key_valid_set (
 static int object_key_valid_set (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		struct object_key_valid *object_key_valid_list,
 		struct object_key_valid *object_key_valid_list,
 		unsigned int object_key_valid_list_entries)
 		unsigned int object_key_valid_list_entries)
 {
 {
@@ -710,10 +711,10 @@ error_exit:
  * object db reading
  * object db reading
  */
  */
 static int object_find_create (
 static int object_find_create (
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	void *object_name,
 	void *object_name,
 	int object_len,
 	int object_len,
-	unsigned int *object_find_handle)
+	hdb_handle_t *object_find_handle)
 {
 {
 	unsigned int res;
 	unsigned int res;
 	struct object_instance *object_instance;
 	struct object_instance *object_instance;
@@ -760,8 +761,8 @@ error_exit:
 }
 }
 
 
 static int object_find_next (
 static int object_find_next (
-	unsigned int object_find_handle,
-	unsigned int *object_handle)
+	hdb_handle_t object_find_handle,
+	hdb_handle_t *object_handle)
 {
 {
 	unsigned int res;
 	unsigned int res;
 	struct object_find_instance *object_find_instance;
 	struct object_find_instance *object_find_instance;
@@ -809,7 +810,7 @@ error_exit:
 }
 }
 
 
 static int object_find_destroy (
 static int object_find_destroy (
-	unsigned int object_find_handle)
+	hdb_handle_t object_find_handle)
 {
 {
 	struct object_find_instance *object_find_instance;
 	struct object_find_instance *object_find_instance;
 	unsigned int res;
 	unsigned int res;
@@ -832,7 +833,7 @@ error_exit:
 }
 }
 
 
 static int object_key_get (
 static int object_key_get (
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	void *key_name,
 	void *key_name,
 	int key_len,
 	int key_len,
 	void **value,
 	void **value,
@@ -881,7 +882,7 @@ error_exit:
 }
 }
 
 
 static int object_key_increment (
 static int object_key_increment (
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	void *key_name,
 	void *key_name,
 	int key_len,
 	int key_len,
 	unsigned int *value)
 	unsigned int *value)
@@ -927,7 +928,7 @@ error_exit:
 }
 }
 
 
 static int object_key_decrement (
 static int object_key_decrement (
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	void *key_name,
 	void *key_name,
 	int key_len,
 	int key_len,
 	unsigned int *value)
 	unsigned int *value)
@@ -973,7 +974,7 @@ error_exit:
 }
 }
 
 
 static int object_key_delete (
 static int object_key_delete (
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	void *key_name,
 	void *key_name,
 	int key_len,
 	int key_len,
 	void *value,
 	void *value,
@@ -1030,7 +1031,7 @@ error_exit:
 }
 }
 
 
 static int object_key_replace (
 static int object_key_replace (
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	void *key_name,
 	void *key_name,
 	int key_len,
 	int key_len,
 	void *old_value,
 	void *old_value,
@@ -1134,7 +1135,7 @@ error_exit:
 }
 }
 
 
 static int object_priv_get (
 static int object_priv_get (
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	void **priv)
 	void **priv)
 {
 {
 	int res;
 	int res;
@@ -1212,7 +1213,7 @@ static int _dump_object(struct object_instance *instance, FILE *file, int depth)
 	return 0;
 	return 0;
 }
 }
 
 
-static int object_key_iter_reset(unsigned int object_handle)
+static int object_key_iter_reset(hdb_handle_t object_handle)
 {
 {
 	unsigned int res;
 	unsigned int res;
 	struct object_instance *instance;
 	struct object_instance *instance;
@@ -1236,7 +1237,7 @@ error_exit:
 }
 }
 
 
 
 
-static int object_key_iter(unsigned int parent_object_handle,
+static int object_key_iter(hdb_handle_t parent_object_handle,
 			   void **key_name,
 			   void **key_name,
 			   int *key_len,
 			   int *key_len,
 			   void **value,
 			   void **value,
@@ -1284,8 +1285,8 @@ error_exit:
 	return (-1);
 	return (-1);
 }
 }
 
 
-static int object_key_iter_from(unsigned int parent_object_handle,
-				unsigned int start_pos,
+static int object_key_iter_from(hdb_handle_t parent_object_handle,
+				hdb_handle_t start_pos,
 				void **key_name,
 				void **key_name,
 				int *key_len,
 				int *key_len,
 				void **value,
 				void **value,
@@ -1341,8 +1342,8 @@ error_exit:
 }
 }
 
 
 
 
-static int object_parent_get(unsigned int object_handle,
-			     unsigned int *parent_handle)
+static int object_parent_get(hdb_handle_t object_handle,
+			     hdb_handle_t *parent_handle)
 {
 {
 	struct object_instance *instance;
 	struct object_instance *instance;
 	unsigned int res;
 	unsigned int res;
@@ -1367,7 +1368,7 @@ static int object_parent_get(unsigned int object_handle,
 	return (0);
 	return (0);
 }
 }
 
 
-static int object_name_get(unsigned int object_handle,
+static int object_name_get(hdb_handle_t object_handle,
 			   char *object_name,
 			   char *object_name,
 			   int *object_name_len)
 			   int *object_name_len)
 {
 {
@@ -1392,7 +1393,7 @@ static int object_name_get(unsigned int object_handle,
 }
 }
 
 
 
 
-static int object_track_start(unsigned int object_handle,
+static int object_track_start(hdb_handle_t object_handle,
 							  object_track_depth_t depth,
 							  object_track_depth_t depth,
 							  object_key_change_notify_fn_t key_change_notify_fn,
 							  object_key_change_notify_fn_t key_change_notify_fn,
 							  object_create_notify_fn_t object_create_notify_fn,
 							  object_create_notify_fn_t object_create_notify_fn,
@@ -1479,7 +1480,7 @@ static void object_track_stop(object_key_change_notify_fn_t key_change_notify_fn
 	}
 	}
 }
 }
 
 
-static int object_dump(unsigned int object_handle,
+static int object_dump(hdb_handle_t object_handle,
 		       FILE *file)
 		       FILE *file)
 {
 {
 	struct object_instance *instance;
 	struct object_instance *instance;

+ 12 - 12
exec/service.c

@@ -86,13 +86,13 @@ static struct default_service default_services[] = {
 
 
 struct corosync_service_engine *ais_service[SERVICE_HANDLER_MAXIMUM_COUNT];
 struct corosync_service_engine *ais_service[SERVICE_HANDLER_MAXIMUM_COUNT];
 
 
-static unsigned int object_internal_configuration_handle;
+static hdb_handle_t object_internal_configuration_handle;
 
 
 
 
 static unsigned int default_services_requested (struct corosync_api_v1 *corosync_api)
 static unsigned int default_services_requested (struct corosync_api_v1 *corosync_api)
 {
 {
-	unsigned int object_service_handle;
-	unsigned int object_find_handle;
+	hdb_handle_t object_service_handle;
+	hdb_handle_t object_find_handle;
 	char *value;
 	char *value;
 
 
 	/*
 	/*
@@ -132,10 +132,10 @@ unsigned int corosync_service_link_and_init (
 {
 {
 	struct corosync_service_engine_iface_ver0 *iface_ver0;
 	struct corosync_service_engine_iface_ver0 *iface_ver0;
 	void *iface_ver0_p;
 	void *iface_ver0_p;
-	unsigned int handle;
+	hdb_handle_t handle;
 	struct corosync_service_engine *service;
 	struct corosync_service_engine *service;
 	unsigned int res;
 	unsigned int res;
-	unsigned int object_service_handle;
+	hdb_handle_t object_service_handle;
 
 
 	/*
 	/*
 	 * reference the service interface
 	 * reference the service interface
@@ -208,7 +208,7 @@ unsigned int corosync_service_link_and_init (
 
 
 static int corosync_service_unlink_common (
 static int corosync_service_unlink_common (
 	struct corosync_api_v1 *corosync_api,
 	struct corosync_api_v1 *corosync_api,
-	unsigned int object_service_handle,
+	hdb_handle_t object_service_handle,
 	const char *service_name,
 	const char *service_name,
 	unsigned int service_version) 
 	unsigned int service_version) 
 {
 {
@@ -245,10 +245,10 @@ extern unsigned int corosync_service_unlink_and_exit (
 	unsigned int service_ver)
 	unsigned int service_ver)
 {
 {
 	unsigned int res;
 	unsigned int res;
-	unsigned int object_service_handle;
+	hdb_handle_t object_service_handle;
 	char *found_service_name;
 	char *found_service_name;
 	unsigned int *found_service_ver;
 	unsigned int *found_service_ver;
-	unsigned int object_find_handle;
+	hdb_handle_t object_find_handle;
 
 
 	corosync_api->object_find_create (
 	corosync_api->object_find_create (
 		object_internal_configuration_handle,
 		object_internal_configuration_handle,
@@ -297,8 +297,8 @@ extern unsigned int corosync_service_unlink_all (
 {
 {
 	char *service_name;
 	char *service_name;
 	unsigned int *service_ver;
 	unsigned int *service_ver;
-	unsigned int object_service_handle;
-	unsigned int object_find_handle;
+	hdb_handle_t object_service_handle;
+	hdb_handle_t object_find_handle;
 	int found; 
 	int found; 
 
 
 	log_printf(LOG_LEVEL_NOTICE, "Unloading all corosync components\n");
 	log_printf(LOG_LEVEL_NOTICE, "Unloading all corosync components\n");
@@ -359,11 +359,11 @@ unsigned int corosync_service_defaults_link_and_init (struct corosync_api_v1 *co
 {
 {
 	unsigned int i;
 	unsigned int i;
 
 
-	unsigned int object_service_handle;
+	hdb_handle_t object_service_handle;
 	char *found_service_name;
 	char *found_service_name;
 	char *found_service_ver;
 	char *found_service_ver;
 	unsigned int found_service_ver_atoi;
 	unsigned int found_service_ver_atoi;
-	unsigned int object_find_handle;
+	hdb_handle_t object_find_handle;
  
  
 	corosync_api->object_create (OBJECT_PARENT_HANDLE,
 	corosync_api->object_create (OBJECT_PARENT_HANDLE,
 		&object_internal_configuration_handle,
 		&object_internal_configuration_handle,

+ 1 - 1
exec/sync.c

@@ -118,7 +118,7 @@ static struct totempg_group sync_group = {
     .group_len  = 4
     .group_len  = 4
 };
 };
 
 
-static totempg_groups_handle sync_group_handle;
+static hdb_handle_t sync_group_handle;
 static char *service_name;
 static char *service_name;
 static unsigned int current_members[PROCESSOR_COUNT_MAX];
 static unsigned int current_members[PROCESSOR_COUNT_MAX];
 static unsigned int current_members_cnt;
 static unsigned int current_members_cnt;

+ 13 - 13
exec/totemconfig.c

@@ -81,13 +81,13 @@ static struct objdb_iface_ver0 *global_objdb;
 static void add_totem_config_notification(
 static void add_totem_config_notification(
 	struct objdb_iface_ver0 *objdb,
 	struct objdb_iface_ver0 *objdb,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
-	unsigned int totem_object_handle);
+	hdb_handle_t totem_object_handle);
 
 
 
 
 /* These just makes the code below a little neater */
 /* These just makes the code below a little neater */
 static inline int objdb_get_string (
 static inline int objdb_get_string (
 	struct objdb_iface_ver0 *objdb,
 	struct objdb_iface_ver0 *objdb,
-	unsigned int object_service_handle,
+	hdb_handle_t object_service_handle,
 	char *key, char **value)
 	char *key, char **value)
 {
 {
 	int res;
 	int res;
@@ -126,9 +126,9 @@ static inline void objdb_get_int (
 
 
 static unsigned int totem_handle_find (
 static unsigned int totem_handle_find (
 	struct objdb_iface_ver0 *objdb,
 	struct objdb_iface_ver0 *objdb,
-	unsigned int *totem_find_handle)  {
+	hdb_handle_t *totem_find_handle)  {
 
 
-	unsigned int object_find_handle;
+	hdb_handle_t object_find_handle;
 	unsigned int res;
 	unsigned int res;
 
 
 	/*
 	/*
@@ -173,7 +173,7 @@ static unsigned int totem_handle_find (
 static void totem_volatile_config_read (
 static void totem_volatile_config_read (
 	struct objdb_iface_ver0 *objdb,
 	struct objdb_iface_ver0 *objdb,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
-	unsigned int object_totem_handle)
+	hdb_handle_t object_totem_handle)
 {
 {
 	objdb_get_int (objdb,object_totem_handle, "token", &totem_config->token_timeout);
 	objdb_get_int (objdb,object_totem_handle, "token", &totem_config->token_timeout);
 
 
@@ -220,11 +220,11 @@ extern int totem_config_read (
 	char **error_string)
 	char **error_string)
 {
 {
 	int res = 0;
 	int res = 0;
-	unsigned int object_totem_handle;
-	unsigned int object_interface_handle;
+	hdb_handle_t object_totem_handle;
+	hdb_handle_t object_interface_handle;
 	char *str;
 	char *str;
 	unsigned int ringnumber = 0;
 	unsigned int ringnumber = 0;
-	unsigned int object_find_interface_handle;
+	hdb_handle_t object_find_interface_handle;
 
 
 	res = totem_handle_find (objdb, &object_totem_handle);
 	res = totem_handle_find (objdb, &object_totem_handle);
 	if (res == -1) {
 	if (res == -1) {
@@ -624,7 +624,7 @@ int totem_config_keyread (
 {
 {
 	int got_key = 0;
 	int got_key = 0;
 	char *key_location = NULL;
 	char *key_location = NULL;
-	unsigned int object_totem_handle;
+	hdb_handle_t object_totem_handle;
 	int res;
 	int res;
 
 
 	memset (totem_config->private_key, 0, 128);
 	memset (totem_config->private_key, 0, 128);
@@ -682,8 +682,8 @@ key_error:
 }
 }
 
 
 static void totem_key_change_notify(object_change_type_t change_type,
 static void totem_key_change_notify(object_change_type_t change_type,
-			      unsigned int parent_object_handle,
-			      unsigned int object_handle,
+			      hdb_handle_t parent_object_handle,
+			      hdb_handle_t object_handle,
 			      void *object_name_pt, int object_name_len,
 			      void *object_name_pt, int object_name_len,
 			      void *key_name_pt, int key_len,
 			      void *key_name_pt, int key_len,
 			      void *key_value_pt, int key_value_len,
 			      void *key_value_pt, int key_value_len,
@@ -701,7 +701,7 @@ static void totem_objdb_reload_notify(objdb_reload_notify_type_t type, int flush
 				      void *priv_data_pt)
 				      void *priv_data_pt)
 {
 {
 	struct totem_config *totem_config = priv_data_pt;
 	struct totem_config *totem_config = priv_data_pt;
-	unsigned int totem_object_handle;
+	hdb_handle_t totem_object_handle;
 
 
 	/*
 	/*
 	 * A new totem {} key might exist, cancel the
 	 * A new totem {} key might exist, cancel the
@@ -745,7 +745,7 @@ static void totem_objdb_reload_notify(objdb_reload_notify_type_t type, int flush
 static void add_totem_config_notification(
 static void add_totem_config_notification(
 	struct objdb_iface_ver0 *objdb,
 	struct objdb_iface_ver0 *objdb,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
-	unsigned int totem_object_handle)
+	hdb_handle_t totem_object_handle)
 {
 {
 
 
 	global_objdb = objdb;
 	global_objdb = objdb;

+ 3 - 2
exec/totemmrp.c

@@ -56,10 +56,11 @@
 
 
 #include <corosync/totem/totem.h>
 #include <corosync/totem/totem.h>
 #include <corosync/totem/coropoll.h>
 #include <corosync/totem/coropoll.h>
+#include <corosync/hdb.h>
 
 
 #include "totemsrp.h"
 #include "totemsrp.h"
 
 
-totemsrp_handle totemsrp_handle_in;
+hdb_handle_t totemsrp_handle_in;
 
 
 void (*pg_deliver_fn) (
 void (*pg_deliver_fn) (
 	unsigned int nodeid,
 	unsigned int nodeid,
@@ -101,7 +102,7 @@ void totemmrp_confchg_fn (
  * Initialize the totem multiple ring protocol
  * Initialize the totem multiple ring protocol
  */
  */
 int totemmrp_initialize (
 int totemmrp_initialize (
-	poll_handle poll_handle,
+	hdb_handle_t poll_handle,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
 
 
 	void (*deliver_fn) (
 	void (*deliver_fn) (

+ 1 - 1
exec/totemmrp.h

@@ -56,7 +56,7 @@ extern void totemmrp_log_printf_init (
  * Initialize the group messaging interface
  * Initialize the group messaging interface
  */
  */
 extern int totemmrp_initialize (
 extern int totemmrp_initialize (
-	poll_handle poll_handle,
+	hdb_handle_t poll_handle,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
 
 
 	void (*deliver_fn) (
 	void (*deliver_fn) (

+ 16 - 16
exec/totemnet.c

@@ -103,7 +103,7 @@ struct totemnet_instance {
 
 
 	unsigned int totemnet_private_key_len;
 	unsigned int totemnet_private_key_len;
 
 
-	poll_handle totemnet_poll_handle;
+	hdb_handle_t totemnet_poll_handle;
 
 
 	struct totem_interface *totem_interface;
 	struct totem_interface *totem_interface;
 
 
@@ -143,7 +143,7 @@ struct totemnet_instance {
 		int line, unsigned int level, char *format,
 		int line, unsigned int level, char *format,
 		...)__attribute__((format(printf, 6, 7)));
 		...)__attribute__((format(printf, 6, 7)));
 
 
-	totemnet_handle handle;
+	hdb_handle_t handle;
 
 
 	char iov_buffer[FRAME_SIZE_MAX];
 	char iov_buffer[FRAME_SIZE_MAX];
 
 
@@ -583,7 +583,7 @@ static void totemnet_mcast_worker_fn (void *thread_state, void *work_item_in)
 }
 }
 
 
 int totemnet_finalize (
 int totemnet_finalize (
-	totemnet_handle handle)
+	hdb_handle_t handle)
 {
 {
 	struct totemnet_instance *instance;
 	struct totemnet_instance *instance;
 	int res = 0;
 	int res = 0;
@@ -608,7 +608,7 @@ error_exit:
  */
  */
 
 
 static int net_deliver_fn (
 static int net_deliver_fn (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int fd,
 	int fd,
 	int revents,
 	int revents,
 	void *data)
 	void *data)
@@ -1151,8 +1151,8 @@ static int totemnet_build_sockets (
  * Create an instance
  * Create an instance
  */
  */
 int totemnet_initialize (
 int totemnet_initialize (
-	poll_handle poll_handle,
-	totemnet_handle *handle,
+	hdb_handle_t poll_handle,
+	hdb_handle_t *handle,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
 	int interface_no,
 	int interface_no,
 	void *context,
 	void *context,
@@ -1251,7 +1251,7 @@ error_destroy:
 }
 }
 
 
 int totemnet_processor_count_set (
 int totemnet_processor_count_set (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	int processor_count)
 	int processor_count)
 {
 {
 	struct totemnet_instance *instance;
 	struct totemnet_instance *instance;
@@ -1280,7 +1280,7 @@ error_exit:
 	return (res);
 	return (res);
 }
 }
 
 
-int totemnet_recv_flush (totemnet_handle handle)
+int totemnet_recv_flush (hdb_handle_t handle)
 {
 {
 	struct totemnet_instance *instance;
 	struct totemnet_instance *instance;
 	struct pollfd ufd;
 	struct pollfd ufd;
@@ -1314,7 +1314,7 @@ error_exit:
 	return (res);
 	return (res);
 }
 }
 
 
-int totemnet_send_flush (totemnet_handle handle)
+int totemnet_send_flush (hdb_handle_t handle)
 {
 {
 	struct totemnet_instance *instance;
 	struct totemnet_instance *instance;
 	int res = 0;
 	int res = 0;
@@ -1335,7 +1335,7 @@ error_exit:
 }
 }
 
 
 int totemnet_token_send (
 int totemnet_token_send (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	int iov_len)
 	int iov_len)
 {
 {
@@ -1357,7 +1357,7 @@ error_exit:
 	return (res);
 	return (res);
 }
 }
 int totemnet_mcast_flush_send (
 int totemnet_mcast_flush_send (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	unsigned int iov_len)
 	unsigned int iov_len)
 {
 {
@@ -1380,7 +1380,7 @@ error_exit:
 }
 }
 
 
 int totemnet_mcast_noflush_send (
 int totemnet_mcast_noflush_send (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	unsigned int iov_len)
 	unsigned int iov_len)
 {
 {
@@ -1411,7 +1411,7 @@ error_exit:
 	return (res);
 	return (res);
 }
 }
 
 
-extern int totemnet_iface_check (totemnet_handle handle)
+extern int totemnet_iface_check (hdb_handle_t handle)
 {
 {
 	struct totemnet_instance *instance;
 	struct totemnet_instance *instance;
 	int res = 0;
 	int res = 0;
@@ -1441,7 +1441,7 @@ extern void totemnet_net_mtu_adjust (struct totem_config *totem_config)
 	}
 	}
 }
 }
 
 
-char *totemnet_iface_print (totemnet_handle handle)  {
+char *totemnet_iface_print (hdb_handle_t handle)  {
 	struct totemnet_instance *instance;
 	struct totemnet_instance *instance;
 	int res = 0;
 	int res = 0;
 	char *ret_char;
 	char *ret_char;
@@ -1461,7 +1461,7 @@ error_exit:
 }
 }
 
 
 int totemnet_iface_get (
 int totemnet_iface_get (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	struct totem_ip_address *addr)
 	struct totem_ip_address *addr)
 {
 {
 	struct totemnet_instance *instance;
 	struct totemnet_instance *instance;
@@ -1482,7 +1482,7 @@ error_exit:
 }
 }
 
 
 int totemnet_token_target_set (
 int totemnet_token_target_set (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	struct totem_ip_address *token_target)
 	struct totem_ip_address *token_target)
 {
 {
 	struct totemnet_instance *instance;
 	struct totemnet_instance *instance;

+ 13 - 15
exec/totemnet.h

@@ -40,8 +40,6 @@
 
 
 #include <corosync/totem/totem.h>
 #include <corosync/totem/totem.h>
 
 
-typedef unsigned int totemnet_handle;
-
 #define TOTEMNET_NOFLUSH	0
 #define TOTEMNET_NOFLUSH	0
 #define TOTEMNET_FLUSH		1
 #define TOTEMNET_FLUSH		1
 /*
 /*
@@ -53,8 +51,8 @@ typedef unsigned int totemnet_handle;
  * Create an instance
  * Create an instance
  */
  */
 extern int totemnet_initialize (
 extern int totemnet_initialize (
-	poll_handle poll_handle,
-	totemnet_handle *handle,
+	hdb_handle_t poll_handle,
+	hdb_handle_t *handle,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
 	int interface_no,
 	int interface_no,
 	void *context,
 	void *context,
@@ -69,42 +67,42 @@ extern int totemnet_initialize (
 		struct totem_ip_address *iface_address));
 		struct totem_ip_address *iface_address));
 
 
 extern int totemnet_processor_count_set (
 extern int totemnet_processor_count_set (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	int processor_count);
 	int processor_count);
 
 
 extern int totemnet_token_send (
 extern int totemnet_token_send (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	int iov_len);
 	int iov_len);
 
 
 extern int totemnet_mcast_flush_send (
 extern int totemnet_mcast_flush_send (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	unsigned int iov_len);
 	unsigned int iov_len);
 
 
 extern int totemnet_mcast_noflush_send (
 extern int totemnet_mcast_noflush_send (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	unsigned int iov_len);
 	unsigned int iov_len);
 
 
-extern int totemnet_recv_flush (totemnet_handle handle);
+extern int totemnet_recv_flush (hdb_handle_t handle);
 
 
-extern int totemnet_send_flush (totemnet_handle handle);
+extern int totemnet_send_flush (hdb_handle_t handle);
 
 
-extern int totemnet_iface_check (totemnet_handle handle);
+extern int totemnet_iface_check (hdb_handle_t handle);
 
 
-extern int totemnet_finalize (totemnet_handle handle);
+extern int totemnet_finalize (hdb_handle_t handle);
 
 
 extern void totemnet_net_mtu_adjust (struct totem_config *totem_config);
 extern void totemnet_net_mtu_adjust (struct totem_config *totem_config);
 
 
-extern char *totemnet_iface_print (totemnet_handle handle);
+extern char *totemnet_iface_print (hdb_handle_t handle);
 
 
 extern int totemnet_iface_get (
 extern int totemnet_iface_get (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	struct totem_ip_address *addr);
 	struct totem_ip_address *addr);
 
 
 extern int totemnet_token_target_set (
 extern int totemnet_token_target_set (
-	totemnet_handle handle,
+	hdb_handle_t handle,
 	struct totem_ip_address *token_target);
 	struct totem_ip_address *token_target);
 
 
 #endif /* TOTEMNET_H_DEFINED */
 #endif /* TOTEMNET_H_DEFINED */

+ 8 - 8
exec/totempg.c

@@ -675,7 +675,7 @@ int callback_token_received_fn (enum totem_callback_token_type type,
  * Initialize the totem process group abstraction
  * Initialize the totem process group abstraction
  */
  */
 int totempg_initialize (
 int totempg_initialize (
-	poll_handle poll_handle,
+	hdb_handle_t poll_handle,
 	struct totem_config *totem_config)
 	struct totem_config *totem_config)
 {
 {
 	int res;
 	int res;
@@ -935,7 +935,7 @@ void totempg_callback_token_destroy (
  */
  */
 
 
 int totempg_groups_initialize (
 int totempg_groups_initialize (
-	totempg_groups_handle *handle,
+	hdb_handle_t *handle,
 
 
 	void (*deliver_fn) (
 	void (*deliver_fn) (
 		unsigned int nodeid,
 		unsigned int nodeid,
@@ -989,7 +989,7 @@ error_exit:
 }
 }
 
 
 int totempg_groups_join (
 int totempg_groups_join (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	struct totempg_group *groups,
 	struct totempg_group *groups,
 	int group_cnt)
 	int group_cnt)
 {
 {
@@ -1024,7 +1024,7 @@ error_exit:
 }
 }
 
 
 int totempg_groups_leave (
 int totempg_groups_leave (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	struct totempg_group *groups,
 	struct totempg_group *groups,
 	int group_cnt)
 	int group_cnt)
 {
 {
@@ -1049,7 +1049,7 @@ error_exit:
 #define MAX_GROUPS_PER_MSG 32
 #define MAX_GROUPS_PER_MSG 32
 
 
 int totempg_groups_mcast_joined (
 int totempg_groups_mcast_joined (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	int iov_len,
 	int iov_len,
 	int guarantee)
 	int guarantee)
@@ -1092,7 +1092,7 @@ error_exit:
 }
 }
 
 
 int totempg_groups_send_ok_joined (
 int totempg_groups_send_ok_joined (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	int iov_len)
 	int iov_len)
 {
 {
@@ -1127,7 +1127,7 @@ error_exit:
 }
 }
 
 
 int totempg_groups_mcast_groups (
 int totempg_groups_mcast_groups (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	int guarantee,
 	int guarantee,
 	struct totempg_group *groups,
 	struct totempg_group *groups,
 	int groups_cnt,
 	int groups_cnt,
@@ -1176,7 +1176,7 @@ error_exit:
  * Returns -1 if error, 0 if can't send, 1 if can send the message
  * Returns -1 if error, 0 if can't send, 1 if can send the message
  */
  */
 int totempg_groups_send_ok_groups (
 int totempg_groups_send_ok_groups (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	struct totempg_group *groups,
 	struct totempg_group *groups,
 	int groups_cnt,
 	int groups_cnt,
 	struct iovec *iovec,
 	struct iovec *iovec,

+ 18 - 18
exec/totemrrp.c

@@ -154,7 +154,7 @@ struct rrp_algo {
 };
 };
 
 
 struct totemrrp_instance {
 struct totemrrp_instance {
-	poll_handle totemrrp_poll_handle;
+	hdb_handle_t totemrrp_poll_handle;
 
 
 	struct totem_interface *interfaces;
 	struct totem_interface *interfaces;
 
 
@@ -200,15 +200,15 @@ struct totemrrp_instance {
 		int line, unsigned int level, char *format,
 		int line, unsigned int level, char *format,
 		...)__attribute__((format(printf, 6, 7)));
 		...)__attribute__((format(printf, 6, 7)));
 
 
-	totemrrp_handle handle;
+	hdb_handle_t handle;
 
 
-	totemnet_handle *net_handles;
+	hdb_handle_t *net_handles;
 
 
 	void *rrp_algo_instance;
 	void *rrp_algo_instance;
 
 
 	int interface_count;
 	int interface_count;
 
 
-	int poll_handle;
+	hdb_handle_t poll_handle;
 
 
 	int processor_count;
 	int processor_count;
 
 
@@ -1348,7 +1348,7 @@ void rrp_iface_change_fn (
 }
 }
 
 
 int totemrrp_finalize (
 int totemrrp_finalize (
-	totemrrp_handle handle)
+	hdb_handle_t handle)
 {
 {
 	struct totemrrp_instance *instance;
 	struct totemrrp_instance *instance;
 	int res = 0;
 	int res = 0;
@@ -1380,8 +1380,8 @@ error_exit:
  * Create an instance
  * Create an instance
  */
  */
 int totemrrp_initialize (
 int totemrrp_initialize (
-	poll_handle poll_handle,
-	totemrrp_handle *handle,
+	hdb_handle_t poll_handle,
+	hdb_handle_t *handle,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
 	void *context,
 	void *context,
 
 
@@ -1453,7 +1453,7 @@ int totemrrp_initialize (
 
 
 	instance->interface_count = totem_config->interface_count;
 	instance->interface_count = totem_config->interface_count;
 
 
-	instance->net_handles = malloc (sizeof (totemnet_handle) * totem_config->interface_count);
+	instance->net_handles = malloc (sizeof (hdb_handle_t) * totem_config->interface_count);
 
 
 	instance->context = context;
 	instance->context = context;
 
 
@@ -1492,7 +1492,7 @@ error_destroy:
 }
 }
 
 
 int totemrrp_processor_count_set (
 int totemrrp_processor_count_set (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	unsigned int processor_count)
 	unsigned int processor_count)
 {
 {
 	struct totemrrp_instance *instance;
 	struct totemrrp_instance *instance;
@@ -1516,7 +1516,7 @@ error_exit:
 }
 }
 
 
 int totemrrp_token_target_set (
 int totemrrp_token_target_set (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	struct totem_ip_address *addr,
 	struct totem_ip_address *addr,
 	unsigned int iface_no)
 	unsigned int iface_no)
 {
 {
@@ -1537,7 +1537,7 @@ int totemrrp_token_target_set (
 error_exit:
 error_exit:
 	return (res);
 	return (res);
 }
 }
-int totemrrp_recv_flush (totemrrp_handle handle)
+int totemrrp_recv_flush (hdb_handle_t handle)
 {
 {
 	struct totemrrp_instance *instance;
 	struct totemrrp_instance *instance;
 	int res = 0;
 	int res = 0;
@@ -1557,7 +1557,7 @@ error_exit:
 	return (res);
 	return (res);
 }
 }
 
 
-int totemrrp_send_flush (totemrrp_handle handle)
+int totemrrp_send_flush (hdb_handle_t handle)
 {
 {
 	struct totemrrp_instance *instance;
 	struct totemrrp_instance *instance;
 	int res = 0;
 	int res = 0;
@@ -1578,7 +1578,7 @@ error_exit:
 }
 }
 
 
 int totemrrp_token_send (
 int totemrrp_token_send (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	unsigned int iov_len)
 	unsigned int iov_len)
 {
 {
@@ -1601,7 +1601,7 @@ error_exit:
 }
 }
 
 
 int totemrrp_mcast_flush_send (
 int totemrrp_mcast_flush_send (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	unsigned int iov_len)
 	unsigned int iov_len)
 {
 {
@@ -1624,7 +1624,7 @@ error_exit:
 }
 }
 
 
 int totemrrp_mcast_noflush_send (
 int totemrrp_mcast_noflush_send (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	unsigned int iov_len)
 	unsigned int iov_len)
 {
 {
@@ -1654,7 +1654,7 @@ error_exit:
 	return (res);
 	return (res);
 }
 }
 
 
-int totemrrp_iface_check (totemrrp_handle handle)
+int totemrrp_iface_check (hdb_handle_t handle)
 {
 {
 	struct totemrrp_instance *instance;
 	struct totemrrp_instance *instance;
 	int res = 0;
 	int res = 0;
@@ -1674,7 +1674,7 @@ error_exit:
 }
 }
 
 
 int totemrrp_ifaces_get (
 int totemrrp_ifaces_get (
-        totemrrp_handle handle,
+        hdb_handle_t handle,
 	char ***status,
 	char ***status,
 	unsigned int *iface_count)
 	unsigned int *iface_count)
 {
 {
@@ -1701,7 +1701,7 @@ error_exit:
 }
 }
 
 
 int totemrrp_ring_reenable (
 int totemrrp_ring_reenable (
-        totemrrp_handle handle)
+        hdb_handle_t handle)
 {
 {
 	struct totemrrp_instance *instance;
 	struct totemrrp_instance *instance;
 	int res = 0;
 	int res = 0;

+ 13 - 15
exec/totemrrp.h

@@ -40,8 +40,6 @@
 
 
 #include <corosync/totem/totem.h>
 #include <corosync/totem/totem.h>
 
 
-typedef unsigned int totemrrp_handle;
-
 #define TOTEMRRP_NOFLUSH	0
 #define TOTEMRRP_NOFLUSH	0
 #define TOTEMRRP_FLUSH		1
 #define TOTEMRRP_FLUSH		1
 
 
@@ -54,8 +52,8 @@ typedef unsigned int totemrrp_handle;
  * Create an instance
  * Create an instance
  */
  */
 extern int totemrrp_initialize (
 extern int totemrrp_initialize (
-	poll_handle poll_handle,
-	totemrrp_handle *handle,
+	hdb_handle_t poll_handle,
+	hdb_handle_t *handle,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
 	void *context,
 	void *context,
 
 
@@ -78,43 +76,43 @@ extern int totemrrp_initialize (
 
 
 
 
 extern int totemrrp_processor_count_set (
 extern int totemrrp_processor_count_set (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	unsigned int processor_count);
 	unsigned int processor_count);
 
 
 extern int totemrrp_token_send (
 extern int totemrrp_token_send (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	unsigned int iov_len);
 	unsigned int iov_len);
 
 
 extern int totemrrp_mcast_noflush_send (
 extern int totemrrp_mcast_noflush_send (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	unsigned int iov_len);
 	unsigned int iov_len);
 
 
 extern int totemrrp_mcast_flush_send (
 extern int totemrrp_mcast_flush_send (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	unsigned int iov_len);
 	unsigned int iov_len);
 
 
-extern int totemrrp_recv_flush (totemrrp_handle handle);
+extern int totemrrp_recv_flush (hdb_handle_t handle);
 
 
-extern int totemrrp_send_flush (totemrrp_handle handle);
+extern int totemrrp_send_flush (hdb_handle_t handle);
 
 
 extern int totemrrp_token_target_set (
 extern int totemrrp_token_target_set (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	struct totem_ip_address *target,
 	struct totem_ip_address *target,
 	unsigned int iface_no);
 	unsigned int iface_no);
 
 
-extern int totemrrp_iface_check (totemrrp_handle handle);
+extern int totemrrp_iface_check (hdb_handle_t handle);
 
 
-extern int totemrrp_finalize (totemrrp_handle handle);
+extern int totemrrp_finalize (hdb_handle_t handle);
 
 
 extern int totemrrp_ifaces_get (
 extern int totemrrp_ifaces_get (
-	totemrrp_handle handle,
+	hdb_handle_t handle,
 	char ***status,
 	char ***status,
 	unsigned int *iface_count);
 	unsigned int *iface_count);
 
 
 extern int totemrrp_ring_reenable (
 extern int totemrrp_ring_reenable (
-	totemrrp_handle handle);
+	hdb_handle_t handle);
 
 
 #endif /* TOTEMRRP_H_DEFINED */
 #endif /* TOTEMRRP_H_DEFINED */

+ 14 - 14
exec/totemsrp.c

@@ -443,7 +443,7 @@ struct totemsrp_instance {
 
 
 	struct iovec totemsrp_iov_recv;
 	struct iovec totemsrp_iov_recv;
 
 
-	poll_handle totemsrp_poll_handle;
+	hdb_handle_t totemsrp_poll_handle;
 
 
 	/*
 	/*
 	 * Function called when new message received
 	 * Function called when new message received
@@ -487,7 +487,7 @@ struct totemsrp_instance {
 
 
 	struct timeval tv_old;
 	struct timeval tv_old;
 
 
-	totemrrp_handle totemrrp_handle;
+	hdb_handle_t totemrrp_handle;
 
 
 	struct totem_config *totem_config;
 	struct totem_config *totem_config;
 
 
@@ -666,8 +666,8 @@ unsigned int main_msgs_missing (void)
  * Exported interfaces
  * Exported interfaces
  */
  */
 int totemsrp_initialize (
 int totemsrp_initialize (
-	poll_handle poll_handle,
-	totemsrp_handle *handle,
+	hdb_handle_t poll_handle,
+	hdb_handle_t *handle,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
 
 
 	void (*deliver_fn) (
 	void (*deliver_fn) (
@@ -844,7 +844,7 @@ error_exit:
 }
 }
 
 
 void totemsrp_finalize (
 void totemsrp_finalize (
-	totemsrp_handle handle)
+	hdb_handle_t handle)
 {
 {
 	struct totemsrp_instance *instance;
 	struct totemsrp_instance *instance;
 	unsigned int res;
 	unsigned int res;
@@ -859,7 +859,7 @@ void totemsrp_finalize (
 }
 }
 
 
 int totemsrp_ifaces_get (
 int totemsrp_ifaces_get (
-	totemsrp_handle handle,
+	hdb_handle_t handle,
 	unsigned int nodeid,
 	unsigned int nodeid,
 	struct totem_ip_address *interfaces,
 	struct totem_ip_address *interfaces,
 	char ***status,
 	char ***status,
@@ -914,7 +914,7 @@ error_exit:
 }
 }
 
 
 unsigned int totemsrp_my_nodeid_get (
 unsigned int totemsrp_my_nodeid_get (
-	totemsrp_handle handle)
+	hdb_handle_t handle)
 {
 {
 	struct totemsrp_instance *instance;
 	struct totemsrp_instance *instance;
 	unsigned int res;
 	unsigned int res;
@@ -932,7 +932,7 @@ unsigned int totemsrp_my_nodeid_get (
 }
 }
 
 
 int totemsrp_my_family_get (
 int totemsrp_my_family_get (
-	totemsrp_handle handle)
+	hdb_handle_t handle)
 {
 {
 	struct totemsrp_instance *instance;
 	struct totemsrp_instance *instance;
 	int res;
 	int res;
@@ -951,7 +951,7 @@ int totemsrp_my_family_get (
 
 
 
 
 int totemsrp_ring_reenable (
 int totemsrp_ring_reenable (
-        totemsrp_handle handle)
+        hdb_handle_t handle)
 {
 {
 	struct totemsrp_instance *instance;
 	struct totemsrp_instance *instance;
 	int res;
 	int res;
@@ -1981,7 +1981,7 @@ originated:
 	return;
 	return;
 }
 }
 
 
-int totemsrp_new_msg_signal (totemsrp_handle handle)
+int totemsrp_new_msg_signal (hdb_handle_t handle)
 {
 {
 	struct totemsrp_instance *instance;
 	struct totemsrp_instance *instance;
 	unsigned int res;
 	unsigned int res;
@@ -2001,7 +2001,7 @@ error_exit:
 }
 }
 
 
 int totemsrp_mcast (
 int totemsrp_mcast (
-	totemsrp_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	int iov_len,
 	int iov_len,
 	int guarantee)
 	int guarantee)
@@ -2088,7 +2088,7 @@ error_exit:
 /*
 /*
  * Determine if there is room to queue a new message
  * Determine if there is room to queue a new message
  */
  */
-int totemsrp_avail (totemsrp_handle handle)
+int totemsrp_avail (hdb_handle_t handle)
 {
 {
 	int avail;
 	int avail;
 	struct totemsrp_instance *instance;
 	struct totemsrp_instance *instance;
@@ -2968,7 +2968,7 @@ static void memb_ring_id_set_and_store (
 }
 }
 
 
 int totemsrp_callback_token_create (
 int totemsrp_callback_token_create (
-	totemsrp_handle handle,
+	hdb_handle_t handle,
 	void **handle_out,
 	void **handle_out,
 	enum totem_callback_token_type type,
 	enum totem_callback_token_type type,
 	int delete,
 	int delete,
@@ -3012,7 +3012,7 @@ error_exit:
 	return (0);
 	return (0);
 }
 }
 
 
-void totemsrp_callback_token_destroy (totemsrp_handle handle, void **handle_out)
+void totemsrp_callback_token_destroy (hdb_handle_t handle, void **handle_out)
 {
 {
 	struct token_callback_instance *h;
 	struct token_callback_instance *h;
 
 

+ 12 - 14
exec/totemsrp.h

@@ -38,8 +38,6 @@
 #include <corosync/totem/totem.h>
 #include <corosync/totem/totem.h>
 #include <corosync/totem/coropoll.h>
 #include <corosync/totem/coropoll.h>
 
 
-typedef unsigned int totemsrp_handle;
-
 /*
 /*
  * Totem Single Ring Protocol
  * Totem Single Ring Protocol
  * depends on poll abstraction, POSIX, IPV4
  * depends on poll abstraction, POSIX, IPV4
@@ -49,8 +47,8 @@ typedef unsigned int totemsrp_handle;
  * Create a protocol instance
  * Create a protocol instance
  */
  */
 int totemsrp_initialize (
 int totemsrp_initialize (
-	poll_handle poll_handle,
-	totemsrp_handle *handle,
+	hdb_handle_t poll_handle,
+	hdb_handle_t *handle,
 	struct totem_config *totem_config,
 	struct totem_config *totem_config,
 
 
 	void (*deliver_fn) (
 	void (*deliver_fn) (
@@ -65,13 +63,13 @@ int totemsrp_initialize (
 		unsigned int *joined_list, int joined_list_entries,
 		unsigned int *joined_list, int joined_list_entries,
 		struct memb_ring_id *ring_id));
 		struct memb_ring_id *ring_id));
 
 
-void totemsrp_finalize (totemsrp_handle handle);
+void totemsrp_finalize (hdb_handle_t handle);
 
 
 /*
 /*
  * Multicast a message
  * Multicast a message
  */
  */
 int totemsrp_mcast (
 int totemsrp_mcast (
-	totemsrp_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	int iov_len,
 	int iov_len,
 	int priority);
 	int priority);
@@ -79,10 +77,10 @@ int totemsrp_mcast (
 /*
 /*
  * Return number of available messages that can be queued
  * Return number of available messages that can be queued
  */
  */
-int totemsrp_avail (totemsrp_handle handle);
+int totemsrp_avail (hdb_handle_t handle);
 
 
 int totemsrp_callback_token_create (
 int totemsrp_callback_token_create (
-	totemsrp_handle handle,
+	hdb_handle_t handle,
 	void **handle_out,
 	void **handle_out,
 	enum totem_callback_token_type type,
 	enum totem_callback_token_type type,
 	int delete,
 	int delete,
@@ -90,27 +88,27 @@ int totemsrp_callback_token_create (
 	void *data);
 	void *data);
 
 
 void totemsrp_callback_token_destroy (
 void totemsrp_callback_token_destroy (
-	totemsrp_handle handle,
+	hdb_handle_t handle,
 	void **handle_out);
 	void **handle_out);
 
 
-int totemsrp_new_msg_signal (totemsrp_handle handle);
+int totemsrp_new_msg_signal (hdb_handle_t handle);
 
 
 extern void totemsrp_net_mtu_adjust (struct totem_config *totem_config);
 extern void totemsrp_net_mtu_adjust (struct totem_config *totem_config);
 
 
 extern int totemsrp_ifaces_get (
 extern int totemsrp_ifaces_get (
-	totemsrp_handle handle,
+	hdb_handle_t handle,
 	unsigned int nodeid,
 	unsigned int nodeid,
 	struct totem_ip_address *interfaces,
 	struct totem_ip_address *interfaces,
 	char ***status,
 	char ***status,
 	unsigned int *iface_count);
 	unsigned int *iface_count);
 
 
 extern unsigned int totemsrp_my_nodeid_get (
 extern unsigned int totemsrp_my_nodeid_get (
-	totemsrp_handle handle);
+	hdb_handle_t handle);
 
 
 extern int totemsrp_my_family_get (
 extern int totemsrp_my_family_get (
-	totemsrp_handle handle);
+	hdb_handle_t handle);
 
 
 extern int totemsrp_ring_reenable (
 extern int totemsrp_ring_reenable (
-	totemsrp_handle handle);
+	hdb_handle_t handle);
 
 
 #endif /* TOTEMSRP_H_DEFINED */
 #endif /* TOTEMSRP_H_DEFINED */

+ 3 - 3
exec/vsf_quorum.c

@@ -254,9 +254,9 @@ static struct quorum_callin_functions callins = {
 
 
 static int quorum_exec_init_fn (struct corosync_api_v1 *api)
 static int quorum_exec_init_fn (struct corosync_api_v1 *api)
 {
 {
-	unsigned int find_handle;
-	unsigned int quorum_handle = 0;
-	unsigned int q_handle;
+	hdb_handle_t find_handle;
+	hdb_handle_t quorum_handle = 0;
+	hdb_handle_t q_handle;
 	char *quorum_module;
 	char *quorum_module;
 	int res;
 	int res;
 	void *quorum_iface_p;
 	void *quorum_iface_p;

+ 1 - 1
exec/vsf_ykd.c

@@ -108,7 +108,7 @@ struct state_received {
 
 
 struct ykd_state ykd_state;
 struct ykd_state ykd_state;
 
 
-static cs_tpg_handle ykd_group_handle;
+static hdb_handle_t ykd_group_handle;
 
 
 static struct state_received state_received_confchg[YKD_PROCESSOR_COUNT_MAX];
 static struct state_received state_received_confchg[YKD_PROCESSOR_COUNT_MAX];
 
 

+ 29 - 27
include/corosync/confdb.h

@@ -35,6 +35,8 @@
 #define COROSYNC_CONFDB_H_DEFINED
 #define COROSYNC_CONFDB_H_DEFINED
 
 
 #include <corosync/corotypes.h>
 #include <corosync/corotypes.h>
+#include <corosync/hdb.h>
+
 /**
 /**
  * @addtogroup confdb_corosync
  * @addtogroup confdb_corosync
  *
  *
@@ -58,8 +60,8 @@ typedef enum {
 typedef void (*confdb_key_change_notify_fn_t) (
 typedef void (*confdb_key_change_notify_fn_t) (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
 	confdb_change_type_t change_type,
 	confdb_change_type_t change_type,
-	unsigned int parent_object_handle,
-	unsigned int object_handle,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
 	void *object_name,
 	void *object_name,
 	int  object_name_len,
 	int  object_name_len,
 	void *key_name,
 	void *key_name,
@@ -69,14 +71,14 @@ typedef void (*confdb_key_change_notify_fn_t) (
 
 
 typedef void (*confdb_object_create_notify_fn_t) (
 typedef void (*confdb_object_create_notify_fn_t) (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
-	unsigned int object_handle,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
 	uint8_t *name_pt,
 	uint8_t *name_pt,
 	int  name_len);
 	int  name_len);
 
 
 typedef void (*confdb_object_delete_notify_fn_t) (
 typedef void (*confdb_object_delete_notify_fn_t) (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	uint8_t *name_pt,
 	uint8_t *name_pt,
 	int  name_len);
 	int  name_len);
 
 
@@ -137,7 +139,7 @@ cs_error_t confdb_dispatch (
  */
  */
 cs_error_t confdb_track_changes (
 cs_error_t confdb_track_changes (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	unsigned int flags);
 	unsigned int flags);
 
 
 cs_error_t confdb_stop_track_changes (
 cs_error_t confdb_stop_track_changes (
@@ -148,26 +150,26 @@ cs_error_t confdb_stop_track_changes (
  */
  */
 cs_error_t confdb_object_create (
 cs_error_t confdb_object_create (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *object_name,
 	void *object_name,
 	int object_name_len,
 	int object_name_len,
-	unsigned int *object_handle);
+	hdb_handle_t *object_handle);
 
 
 cs_error_t confdb_object_destroy (
 cs_error_t confdb_object_destroy (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int object_handle);
+	hdb_handle_t object_handle);
 
 
 cs_error_t confdb_object_parent_get (
 cs_error_t confdb_object_parent_get (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int object_handle,
-	unsigned int *parent_object_handle);
+	hdb_handle_t object_handle,
+	hdb_handle_t *parent_object_handle);
 
 
 /*
 /*
  * Manipulate keys
  * Manipulate keys
  */
  */
 cs_error_t confdb_key_create (
 cs_error_t confdb_key_create (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *value,
 	void *value,
@@ -175,7 +177,7 @@ cs_error_t confdb_key_create (
 
 
 cs_error_t confdb_key_delete (
 cs_error_t confdb_key_delete (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *value,
 	void *value,
@@ -186,7 +188,7 @@ cs_error_t confdb_key_delete (
  */
  */
 cs_error_t confdb_key_get (
 cs_error_t confdb_key_get (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *value,
 	void *value,
@@ -194,7 +196,7 @@ cs_error_t confdb_key_get (
 
 
 cs_error_t confdb_key_replace (
 cs_error_t confdb_key_replace (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *old_value,
 	void *old_value,
@@ -204,14 +206,14 @@ cs_error_t confdb_key_replace (
 
 
 cs_error_t confdb_key_increment (
 cs_error_t confdb_key_increment (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	unsigned int *value);
 	unsigned int *value);
 
 
 cs_error_t confdb_key_decrement (
 cs_error_t confdb_key_decrement (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	unsigned int *value);
 	unsigned int *value);
@@ -224,44 +226,44 @@ cs_error_t confdb_key_decrement (
  */
  */
 cs_error_t confdb_object_find_start (
 cs_error_t confdb_object_find_start (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle);
+	hdb_handle_t parent_object_handle);
 
 
 cs_error_t confdb_object_find (
 cs_error_t confdb_object_find (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *object_name,
 	void *object_name,
 	int object_name_len,
 	int object_name_len,
-	unsigned int *object_handle);
+	hdb_handle_t *object_handle);
 
 
 cs_error_t confdb_object_find_destroy(
 cs_error_t confdb_object_find_destroy(
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle);
+	hdb_handle_t parent_object_handle);
 
 
 cs_error_t confdb_object_iter_start (
 cs_error_t confdb_object_iter_start (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle);
+	hdb_handle_t parent_object_handle);
 
 
 cs_error_t confdb_object_iter (
 cs_error_t confdb_object_iter (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
-	unsigned int *object_handle,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t *object_handle,
 	void *object_name,
 	void *object_name,
 	int *object_name_len);
 	int *object_name_len);
 
 
 cs_error_t confdb_object_iter_destroy(
 cs_error_t confdb_object_iter_destroy(
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle);
+	hdb_handle_t parent_object_handle);
 
 
 /*
 /*
  * Key iterator
  * Key iterator
  */
  */
 cs_error_t confdb_key_iter_start (
 cs_error_t confdb_key_iter_start (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int object_handle);
+	hdb_handle_t object_handle);
 
 
 cs_error_t confdb_key_iter (
 cs_error_t confdb_key_iter (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int *key_name_len,
 	int *key_name_len,
 	void *value,
 	void *value,

+ 72 - 66
include/corosync/engine/coroapi.h

@@ -38,11 +38,10 @@
 #ifdef COROSYNC_BSD
 #ifdef COROSYNC_BSD
 #include <sys/uio.h>
 #include <sys/uio.h>
 #endif
 #endif
+#include <corosync/hdb.h>
 
 
 typedef void * corosync_timer_handle_t;
 typedef void * corosync_timer_handle_t;
 
 
-typedef unsigned int cs_tpg_handle;
-
 struct corosync_tpg_group {
 struct corosync_tpg_group {
 	void *group;
 	void *group;
 	int group_len;
 	int group_len;
@@ -164,30 +163,37 @@ typedef enum {
 	OBJDB_RELOAD_NOTIFY_FAILED
 	OBJDB_RELOAD_NOTIFY_FAILED
 } objdb_reload_notify_type_t;
 } objdb_reload_notify_type_t;
 
 
-typedef void (*object_key_change_notify_fn_t)(object_change_type_t change_type,
-											  unsigned int parent_object_handle,
-											  unsigned int object_handle,
-											  void *object_name_pt, int object_name_len,
-											  void *key_name_pt, int key_len,
-											  void *key_value_pt, int key_value_len,
-											  void *priv_data_pt);
-
-typedef void (*object_create_notify_fn_t) (unsigned int parent_object_handle,
-										   unsigned int object_handle,
-										   uint8_t *name_pt, int name_len,
-										   void *priv_data_pt);
-
-typedef void (*object_destroy_notify_fn_t) (unsigned int parent_object_handle,
-											uint8_t *name_pt, int name_len,
-											void *priv_data_pt);
-typedef void (*object_notify_callback_fn_t)(unsigned int object_handle,
-											void *key_name, int key_len,
-											void *value, int value_len,
-											object_change_type_t type,
-											void * priv_data_pt);
-
-typedef void (*object_reload_notify_fn_t) (objdb_reload_notify_type_t, int flush,
-											void *priv_data_pt);
+typedef void (*object_key_change_notify_fn_t)(
+	object_change_type_t change_type,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
+	void *object_name_pt, int object_name_len,
+	void *key_name_pt, int key_len,
+	void *key_value_pt, int key_value_len,
+	void *priv_data_pt);
+
+typedef void (*object_create_notify_fn_t) (
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
+	uint8_t *name_pt, int name_len,
+	void *priv_data_pt);
+
+typedef void (*object_destroy_notify_fn_t) (
+	hdb_handle_t parent_object_handle,
+	uint8_t *name_pt, int name_len,
+	void *priv_data_pt);
+
+typedef void (*object_notify_callback_fn_t)(
+	hdb_handle_t object_handle,
+	void *key_name, int key_len,
+	void *value, int value_len,
+	object_change_type_t type,
+	void * priv_data_pt);
+
+typedef void (*object_reload_notify_fn_t) (
+	objdb_reload_notify_type_t,
+	int flush,
+	void *priv_data_pt);
 
 
 #endif /* OBJECT_PARENT_HANDLE_DEFINED */
 #endif /* OBJECT_PARENT_HANDLE_DEFINED */
 
 
@@ -215,60 +221,60 @@ struct corosync_api_v1 {
 	 * Object and configuration APIs
 	 * Object and configuration APIs
 	 */
 	 */
 	int (*object_create) (
 	int (*object_create) (
-		unsigned int parent_object_handle,
-		unsigned int *object_handle,
+		hdb_handle_t parent_object_handle,
+		hdb_handle_t *object_handle,
 		void *object_name, unsigned int object_name_len);
 		void *object_name, unsigned int object_name_len);
 
 
 	int (*object_priv_set) (
 	int (*object_priv_set) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *priv);
 		void *priv);
 
 
 	int (*object_key_create) (
 	int (*object_key_create) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		void *value,
 		void *value,
 		int value_len);
 		int value_len);
 
 
 	int (*object_destroy) (
 	int (*object_destroy) (
-		unsigned int object_handle);
+		hdb_handle_t object_handle);
 
 
 	int (*object_valid_set) (
 	int (*object_valid_set) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		struct object_valid *object_valid_list,
 		struct object_valid *object_valid_list,
 		unsigned int object_valid_list_entries);
 		unsigned int object_valid_list_entries);
 
 
 	int (*object_key_valid_set) (
 	int (*object_key_valid_set) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		struct object_key_valid *object_key_valid_list,
 		struct object_key_valid *object_key_valid_list,
 		unsigned int object_key_valid_list_entries);
 		unsigned int object_key_valid_list_entries);
 
 
 	int (*object_find_create) (
 	int (*object_find_create) (
-		unsigned int parent_object_handle,
+		hdb_handle_t parent_object_handle,
 		void *object_name,
 		void *object_name,
 		int object_name_len,
 		int object_name_len,
-		unsigned int *object_find_handle);
+		hdb_handle_t *object_find_handle);
 
 
 	int (*object_find_next) (
 	int (*object_find_next) (
-		unsigned int object_find_handle,
-		unsigned int *object_handle);
+		hdb_handle_t object_find_handle,
+		hdb_handle_t *object_handle);
 
 
 	int (*object_find_destroy) (
 	int (*object_find_destroy) (
-		unsigned int object_find_handle);
+		hdb_handle_t object_find_handle);
 
 
 	int (*object_key_get) (
 	int (*object_key_get) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		void **value,
 		void **value,
 		int *value_len);
 		int *value_len);
 
 
 	int (*object_priv_get) (
 	int (*object_priv_get) (
-		unsigned int jobject_handle,
+		hdb_handle_t jobject_handle,
 		void **priv);
 		void **priv);
 
 
 	int (*object_key_replace) (
 	int (*object_key_replace) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		void *old_value,
 		void *old_value,
@@ -277,54 +283,54 @@ struct corosync_api_v1 {
 		int new_value_len);
 		int new_value_len);
 
 
 	int (*object_key_delete) (
 	int (*object_key_delete) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		void *value,
 		void *value,
 		int value_len);
 		int value_len);
 
 
 	int (*object_iter_reset) (
 	int (*object_iter_reset) (
-		unsigned int parent_object_handle);
+		hdb_handle_t parent_object_handle);
 
 
 	int (*object_iter) (
 	int (*object_iter) (
-		unsigned int parent_object_handle,
+		hdb_handle_t parent_object_handle,
 		void **object_name,
 		void **object_name,
 		int *name_len,
 		int *name_len,
-		unsigned int *object_handle);
+		hdb_handle_t *object_handle);
 
 
 	int (*object_key_iter_reset) (
 	int (*object_key_iter_reset) (
-		unsigned int object_handle);
+		hdb_handle_t object_handle);
 
 
 	int (*object_key_iter) (
 	int (*object_key_iter) (
-		unsigned int parent_object_handle,
+		hdb_handle_t parent_object_handle,
 		void **key_name,
 		void **key_name,
 		int *key_len,
 		int *key_len,
 		void **value,
 		void **value,
 		int *value_len);
 		int *value_len);
 
 
 	int (*object_parent_get) (
 	int (*object_parent_get) (
-		unsigned int object_handle,
-		unsigned int *parent_handle);
+		hdb_handle_t object_handle,
+		hdb_handle_t *parent_handle);
 
 
 	int (*object_name_get) (
 	int (*object_name_get) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		char *object_name,
 		char *object_name,
 		int *object_name_len);
 		int *object_name_len);
 
 
 	int (*object_dump) (
 	int (*object_dump) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		FILE *file);
 		FILE *file);
 
 
 	int (*object_key_iter_from) (
 	int (*object_key_iter_from) (
-		unsigned int parent_object_handle,
-		unsigned int start_pos,
+		hdb_handle_t parent_object_handle,
+		hdb_handle_t start_pos,
 		void **key_name,
 		void **key_name,
 		int *key_len,
 		int *key_len,
 		void **value,
 		void **value,
 		int *value_len);
 		int *value_len);
 
 
 	int (*object_track_start) (
 	int (*object_track_start) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		object_track_depth_t depth,
 		object_track_depth_t depth,
 		object_key_change_notify_fn_t key_change_notify_fn,
 		object_key_change_notify_fn_t key_change_notify_fn,
 		object_create_notify_fn_t object_create_notify_fn,
 		object_create_notify_fn_t object_create_notify_fn,
@@ -345,13 +351,13 @@ struct corosync_api_v1 {
 				     char **error_string);
 				     char **error_string);
 
 
 	int (*object_key_increment) (
 	int (*object_key_increment) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		unsigned int *value);
 		unsigned int *value);
 
 
 	int (*object_key_decrement) (
 	int (*object_key_decrement) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		unsigned int *value);
 		unsigned int *value);
@@ -436,7 +442,7 @@ struct corosync_api_v1 {
 	 * wanting their own groups
 	 * wanting their own groups
 	 */
 	 */
 	int (*tpg_init) (
 	int (*tpg_init) (
-		cs_tpg_handle *handle,
+		hdb_handle_t *handle,
 
 
 		void (*deliver_fn) (
 		void (*deliver_fn) (
 			unsigned int nodeid,
 			unsigned int nodeid,
@@ -452,31 +458,31 @@ struct corosync_api_v1 {
 			struct memb_ring_id *ring_id));
 			struct memb_ring_id *ring_id));
 
 
 	int (*tpg_exit) (
 	int (*tpg_exit) (
-       		cs_tpg_handle handle);
+       		hdb_handle_t handle);
 
 
 	int (*tpg_join) (
 	int (*tpg_join) (
-		cs_tpg_handle handle,
+		hdb_handle_t handle,
 		struct corosync_tpg_group *groups,
 		struct corosync_tpg_group *groups,
 		int gruop_cnt);
 		int gruop_cnt);
 
 
 	int (*tpg_leave) (
 	int (*tpg_leave) (
-		cs_tpg_handle handle,
+		hdb_handle_t handle,
 		struct corosync_tpg_group *groups,
 		struct corosync_tpg_group *groups,
 		int gruop_cnt);
 		int gruop_cnt);
 
 
 	int (*tpg_joined_mcast) (
 	int (*tpg_joined_mcast) (
-		cs_tpg_handle handle,
+		hdb_handle_t handle,
 		struct iovec *iovec,
 		struct iovec *iovec,
 		int iov_len,
 		int iov_len,
 		int guarantee);
 		int guarantee);
 
 
 	int (*tpg_joined_send_ok) (
 	int (*tpg_joined_send_ok) (
-		cs_tpg_handle handle,
+		hdb_handle_t handle,
 		struct iovec *iovec,
 		struct iovec *iovec,
 		int iov_len);
 		int iov_len);
 
 
 	int (*tpg_groups_mcast) (
 	int (*tpg_groups_mcast) (
-		cs_tpg_handle handle,
+		hdb_handle_t handle,
 		int guarantee,
 		int guarantee,
 		struct corosync_tpg_group *groups,
 		struct corosync_tpg_group *groups,
 		int groups_cnt,
 		int groups_cnt,
@@ -484,7 +490,7 @@ struct corosync_api_v1 {
 		int iov_len);
 		int iov_len);
 
 
 	int (*tpg_groups_send_ok) (
 	int (*tpg_groups_send_ok) (
-		cs_tpg_handle handle,
+		hdb_handle_t handle,
 		struct corosync_tpg_group *groups,
 		struct corosync_tpg_group *groups,
 		int groups_cnt,
 		int groups_cnt,
 		struct iovec *iovec,
 		struct iovec *iovec,
@@ -510,13 +516,13 @@ struct corosync_api_v1 {
 	 * Plugin loading and unloading
 	 * Plugin loading and unloading
 	 */
 	 */
 	int (*plugin_interface_reference) (
 	int (*plugin_interface_reference) (
-		unsigned int *handle, 
+		hdb_handle_t *handle, 
 		char *iface_name,
 		char *iface_name,
 		int version,
 		int version,
 		void **interface,
 		void **interface,
 		void *context);
 		void *context);
 
 
-	int (*plugin_interface_release) (unsigned int handle);
+	int (*plugin_interface_release) (hdb_handle_t handle);
 
 
 	/*
 	/*
 	 * Service loading and unloading APIs
 	 * Service loading and unloading APIs

+ 42 - 40
include/corosync/engine/objdb.h

@@ -39,6 +39,7 @@
 #define OBJECT_PARENT_HANDLE 0
 #define OBJECT_PARENT_HANDLE 0
 
 
 #include <stdio.h>
 #include <stdio.h>
+#include <corosync/hdb.h>
 
 
 typedef enum {
 typedef enum {
 	OBJECT_TRACK_DEPTH_ONE,
 	OBJECT_TRACK_DEPTH_ONE,
@@ -58,18 +59,19 @@ typedef enum {
 } objdb_reload_notify_type_t;
 } objdb_reload_notify_type_t;
 
 
 
 
-typedef void (*object_key_change_notify_fn_t)(object_change_type_t change_type,
-											  unsigned int parent_object_handle,
-											  unsigned int object_handle,
-											  void *object_name_pt, int object_name_len,
-											  void *key_name_pt, int key_len,
-											  void *key_value_pt, int key_value_len,
-											  void *priv_data_pt);
+typedef void (*object_key_change_notify_fn_t)(
+	object_change_type_t change_type,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
+	void *object_name_pt, int object_name_len,
+	void *key_name_pt, int key_len,
+	void *key_value_pt, int key_value_len,
+void *priv_data_pt);
 
 
 typedef void (*object_create_notify_fn_t) (unsigned int parent_object_handle,
 typedef void (*object_create_notify_fn_t) (unsigned int parent_object_handle,
-										   unsigned int object_handle,
-										   void *name_pt, int name_len,
-										   void *priv_data_pt);
+hdb_handle_t object_handle,
+void *name_pt, int name_len,
+void *priv_data_pt);
 
 
 typedef void (*object_destroy_notify_fn_t) (unsigned int parent_object_handle,
 typedef void (*object_destroy_notify_fn_t) (unsigned int parent_object_handle,
 											void *name_pt, int name_len,
 											void *name_pt, int name_len,
@@ -93,61 +95,61 @@ struct objdb_iface_ver0 {
 	int (*objdb_init) (void);
 	int (*objdb_init) (void);
 
 
 	int (*object_create) (
 	int (*object_create) (
-		unsigned int parent_object_handle,
-		unsigned int *object_handle,
+		hdb_handle_t parent_object_handle,
+		hdb_handle_t *object_handle,
 		void *object_name,
 		void *object_name,
 		unsigned int object_name_len);
 		unsigned int object_name_len);
 
 
 	int (*object_priv_set) (
 	int (*object_priv_set) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *priv);
 		void *priv);
 
 
 	int (*object_key_create) (
 	int (*object_key_create) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		void *value,
 		void *value,
 		int value_len);
 		int value_len);
 
 
 	int (*object_destroy) (
 	int (*object_destroy) (
-		unsigned int object_handle);
+		hdb_handle_t object_handle);
 
 
 	int (*object_valid_set) (
 	int (*object_valid_set) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		struct object_valid *object_valid_list,
 		struct object_valid *object_valid_list,
 		unsigned int object_valid_list_entries);
 		unsigned int object_valid_list_entries);
 
 
 	int (*object_key_valid_set) (
 	int (*object_key_valid_set) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		struct object_key_valid *object_key_valid_list,
 		struct object_key_valid *object_key_valid_list,
 		unsigned int object_key_valid_list_entries);
 		unsigned int object_key_valid_list_entries);
 
 
 	int (*object_find_create) (
 	int (*object_find_create) (
-		unsigned int parent_object_handle,
+		hdb_handle_t parent_object_handle,
 		void *object_name,
 		void *object_name,
 		int object_name_len,
 		int object_name_len,
-		unsigned int *object_find_handle);
+		hdb_handle_t *object_find_handle);
 
 
 	int (*object_find_next) (
 	int (*object_find_next) (
-		unsigned int object_find_handle,
-		unsigned int *object_handle);
+		hdb_handle_t object_find_handle,
+		hdb_handle_t *object_handle);
 
 
 	int (*object_find_destroy) (
 	int (*object_find_destroy) (
-		unsigned int object_find_handle);
+		hdb_handle_t object_find_handle);
 
 
 	int (*object_key_get) (
 	int (*object_key_get) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		void **value,
 		void **value,
 		int *value_len);
 		int *value_len);
 
 
 	int (*object_priv_get) (
 	int (*object_priv_get) (
-		unsigned int jobject_handle,
+		hdb_handle_t jobject_handle,
 		void **priv);
 		void **priv);
 
 
 	int (*object_key_replace) (
 	int (*object_key_replace) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		void *old_value,
 		void *old_value,
@@ -156,54 +158,54 @@ struct objdb_iface_ver0 {
 		int new_value_len);
 		int new_value_len);
 
 
 	int (*object_key_delete) (
 	int (*object_key_delete) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		void *value,
 		void *value,
 		int value_len);
 		int value_len);
 
 
 	int (*object_iter_reset) (
 	int (*object_iter_reset) (
-		unsigned int parent_object_handle);
+		hdb_handle_t parent_object_handle);
 
 
 	int (*object_iter) (
 	int (*object_iter) (
-		unsigned int parent_object_handle,
+		hdb_handle_t parent_object_handle,
 		void **object_name,
 		void **object_name,
 		int *name_len,
 		int *name_len,
-		unsigned int *object_handle);
+		hdb_handle_t *object_handle);
 
 
 	int (*object_key_iter_reset) (
 	int (*object_key_iter_reset) (
-		unsigned int object_handle);
+		hdb_handle_t object_handle);
 
 
 	int (*object_key_iter) (
 	int (*object_key_iter) (
-		unsigned int parent_object_handle,
+		hdb_handle_t parent_object_handle,
 		void **key_name,
 		void **key_name,
 		int *key_len,
 		int *key_len,
 		void **value,
 		void **value,
 		int *value_len);
 		int *value_len);
 
 
 	int (*object_parent_get) (
 	int (*object_parent_get) (
-		unsigned int object_handle,
-		unsigned int *parent_handle);
+		hdb_handle_t object_handle,
+		hdb_handle_t *parent_handle);
 
 
 	int (*object_name_get) (
 	int (*object_name_get) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		char *object_name,
 		char *object_name,
 		int *object_name_len);
 		int *object_name_len);
 
 
 	int (*object_dump) (
 	int (*object_dump) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		FILE *file);
 		FILE *file);
 
 
 	int (*object_key_iter_from) (
 	int (*object_key_iter_from) (
-		unsigned int parent_object_handle,
-		unsigned int start_pos,
+		hdb_handle_t parent_object_handle,
+		hdb_handle_t start_pos,
 		void **key_name,
 		void **key_name,
 		int *key_len,
 		int *key_len,
 		void **value,
 		void **value,
 		int *value_len);
 		int *value_len);
 
 
 	int (*object_track_start) (
 	int (*object_track_start) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		object_track_depth_t depth,
 		object_track_depth_t depth,
 		object_key_change_notify_fn_t key_change_notify_fn,
 		object_key_change_notify_fn_t key_change_notify_fn,
 		object_create_notify_fn_t object_create_notify_fn,
 		object_create_notify_fn_t object_create_notify_fn,
@@ -225,13 +227,13 @@ struct objdb_iface_ver0 {
 		char **error_string);
 		char **error_string);
 
 
 	int (*object_key_increment) (
 	int (*object_key_increment) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		unsigned int *value);
 		unsigned int *value);
 
 
 	int (*object_key_decrement) (
 	int (*object_key_decrement) (
-		unsigned int object_handle,
+		hdb_handle_t object_handle,
 		void *key_name,
 		void *key_name,
 		int key_len,
 		int key_len,
 		unsigned int *value);
 		unsigned int *value);

+ 7 - 5
include/corosync/hdb.h

@@ -1,6 +1,6 @@
 /*
 /*
  * Copyright (c) 2002-2006 MontaVista Software, Inc.
  * Copyright (c) 2002-2006 MontaVista Software, Inc.
- * Copyright (c) 2006-2008 Red Hat, Inc.
+ * Copyright (c) 2006-2009 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *
@@ -41,6 +41,8 @@
 #include <assert.h>
 #include <assert.h>
 #include <pthread.h>
 #include <pthread.h>
 
 
+typedef unsigned long long hdb_handle_t;
+
 enum HDB_HANDLE_STATE {
 enum HDB_HANDLE_STATE {
 	HDB_HANDLE_STATE_EMPTY,
 	HDB_HANDLE_STATE_EMPTY,
 	HDB_HANDLE_STATE_PENDINGREMOVAL,
 	HDB_HANDLE_STATE_PENDINGREMOVAL,
@@ -81,7 +83,7 @@ static inline void hdb_destroy (
 static inline int hdb_handle_create (
 static inline int hdb_handle_create (
 	struct hdb_handle_database *handle_database,
 	struct hdb_handle_database *handle_database,
 	int instance_size,
 	int instance_size,
-	unsigned int *handle_id_out)
+	hdb_handle_t *handle_id_out)
 {
 {
 	int handle;
 	int handle;
 	void *new_handles;
 	void *new_handles;
@@ -129,7 +131,7 @@ static inline int hdb_handle_create (
 
 
 static inline int hdb_handle_get (
 static inline int hdb_handle_get (
 	struct hdb_handle_database *handle_database,
 	struct hdb_handle_database *handle_database,
-	unsigned int handle,
+	hdb_handle_t handle,
 	void **instance)
 	void **instance)
 {
 {
 	pthread_mutex_lock (&handle_database->mutex);
 	pthread_mutex_lock (&handle_database->mutex);
@@ -155,7 +157,7 @@ static inline int hdb_handle_get (
 
 
 static inline void hdb_handle_put (
 static inline void hdb_handle_put (
 	struct hdb_handle_database *handle_database,
 	struct hdb_handle_database *handle_database,
-	unsigned int handle)
+	hdb_handle_t handle)
 {
 {
 	pthread_mutex_lock (&handle_database->mutex);
 	pthread_mutex_lock (&handle_database->mutex);
 	handle_database->handles[handle].ref_count -= 1;
 	handle_database->handles[handle].ref_count -= 1;
@@ -188,7 +190,7 @@ static inline void hdb_iterator_reset (
 static inline int hdb_iterator_next (
 static inline int hdb_iterator_next (
 	struct hdb_handle_database *handle_database,
 	struct hdb_handle_database *handle_database,
 	void **instance,
 	void **instance,
-	unsigned int *handle)
+	hdb_handle_t *handle)
 {
 {
 	int res = -1;
 	int res = -1;
 
 

+ 27 - 27
include/corosync/ipc_confdb.h

@@ -84,48 +84,48 @@ enum res_confdb_types {
 
 
 struct req_lib_confdb_object_create {
 struct req_lib_confdb_object_create {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t parent_object_handle __attribute__((aligned(8)));
+	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
 };
 };
 
 
 struct res_lib_confdb_object_create {
 struct res_lib_confdb_object_create {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
 };
 };
 
 
 struct req_lib_confdb_object_destroy {
 struct req_lib_confdb_object_destroy {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
 };
 };
 
 
 struct req_lib_confdb_object_parent_get {
 struct req_lib_confdb_object_parent_get {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
 };
 };
 
 
 struct res_lib_confdb_object_parent_get {
 struct res_lib_confdb_object_parent_get {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));
-	mar_uint32_t parent_object_handle __attribute__((aligned(8)));
+	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 };
 };
 
 
 
 
 struct req_lib_confdb_key_create {
 struct req_lib_confdb_key_create {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t value __attribute__((aligned(8)));
 	mar_name_t value __attribute__((aligned(8)));
 };
 };
 
 
 struct req_lib_confdb_key_delete {
 struct req_lib_confdb_key_delete {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t value __attribute__((aligned(8)));
 	mar_name_t value __attribute__((aligned(8)));
 };
 };
 
 
 struct req_lib_confdb_key_replace {
 struct req_lib_confdb_key_replace {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t old_value __attribute__((aligned(8)));
 	mar_name_t old_value __attribute__((aligned(8)));
 	mar_name_t new_value __attribute__((aligned(8)));
 	mar_name_t new_value __attribute__((aligned(8)));
@@ -133,34 +133,34 @@ struct req_lib_confdb_key_replace {
 
 
 struct req_lib_confdb_object_find {
 struct req_lib_confdb_object_find {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t parent_object_handle __attribute__((aligned(8)));
+	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
-	mar_uint32_t find_handle __attribute__((aligned(8)));
+	mar_uint64_t find_handle __attribute__((aligned(8)));
 };
 };
 
 
 struct res_lib_confdb_object_find {
 struct res_lib_confdb_object_find {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
-	mar_uint32_t find_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t find_handle __attribute__((aligned(8)));
 };
 };
 
 
 struct req_lib_confdb_object_iter {
 struct req_lib_confdb_object_iter {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t parent_object_handle __attribute__((aligned(8)));
-	mar_uint32_t find_handle __attribute__((aligned(8)));
+	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
+	mar_uint64_t find_handle __attribute__((aligned(8)));
 };
 };
 
 
 struct res_lib_confdb_object_iter {
 struct res_lib_confdb_object_iter {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
-	mar_uint32_t find_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t find_handle __attribute__((aligned(8)));
 };
 };
 
 
 struct req_lib_confdb_key_iter {
 struct req_lib_confdb_key_iter {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t parent_object_handle __attribute__((aligned(8)));
-	mar_uint32_t next_entry __attribute__((aligned(8)));
+	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
+	mar_uint64_t next_entry __attribute__((aligned(8)));
 };
 };
 
 
 struct res_lib_confdb_key_iter {
 struct res_lib_confdb_key_iter {
@@ -171,13 +171,13 @@ struct res_lib_confdb_key_iter {
 
 
 struct req_lib_confdb_key_get {
 struct req_lib_confdb_key_get {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t parent_object_handle __attribute__((aligned(8)));
+	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 };
 };
 
 
 struct req_lib_confdb_object_find_destroy {
 struct req_lib_confdb_object_find_destroy {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t find_handle __attribute__((aligned(8)));
+	mar_uint64_t find_handle __attribute__((aligned(8)));
 };
 };
 
 
 struct res_lib_confdb_key_get {
 struct res_lib_confdb_key_get {
@@ -207,9 +207,9 @@ struct res_lib_confdb_reload {
 
 
 struct res_lib_confdb_key_change_callback {
 struct res_lib_confdb_key_change_callback {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));
-	mar_uint32_t change_type __attribute__((aligned(8)));
-	mar_uint32_t parent_object_handle __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t change_type __attribute__((aligned(8)));
+	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
 	mar_name_t object_name __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t key_name __attribute__((aligned(8)));
 	mar_name_t key_value __attribute__((aligned(8)));
 	mar_name_t key_value __attribute__((aligned(8)));
@@ -217,20 +217,20 @@ struct res_lib_confdb_key_change_callback {
 
 
 struct res_lib_confdb_object_create_callback {
 struct res_lib_confdb_object_create_callback {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));
-	mar_uint32_t parent_object_handle __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_name_t name __attribute__((aligned(8)));
 	mar_name_t name __attribute__((aligned(8)));
 };
 };
 
 
 struct res_lib_confdb_object_destroy_callback {
 struct res_lib_confdb_object_destroy_callback {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));
-	mar_uint32_t parent_object_handle __attribute__((aligned(8)));
+	mar_uint64_t parent_object_handle __attribute__((aligned(8)));
 	mar_name_t name __attribute__((aligned(8)));
 	mar_name_t name __attribute__((aligned(8)));
 };
 };
 
 
 struct req_lib_confdb_object_track_start {
 struct req_lib_confdb_object_track_start {
 	mar_req_header_t header __attribute__((aligned(8)));
 	mar_req_header_t header __attribute__((aligned(8)));
-	mar_uint32_t object_handle __attribute__((aligned(8)));
+	mar_uint64_t object_handle __attribute__((aligned(8)));
 	mar_uint32_t flags __attribute__((aligned(8)));
 	mar_uint32_t flags __attribute__((aligned(8)));
 };
 };
 
 

+ 4 - 2
include/corosync/lcr/lcr_ifact.h

@@ -31,14 +31,16 @@
 #ifndef LCR_IFACT_H_DEFINED
 #ifndef LCR_IFACT_H_DEFINED
 #define LCR_IFACT_H_DEFINED
 #define LCR_IFACT_H_DEFINED
 
 
+#include <corosync/hdb.h>
+
 int lcr_ifact_reference (
 int lcr_ifact_reference (
-	unsigned int *handle,
+	hdb_handle_t *handle,
 	char *iface_name,
 	char *iface_name,
 	int version,
 	int version,
 	void **interface,
 	void **interface,
 	void *context);
 	void *context);
 
 
 int lcr_ifact_release (
 int lcr_ifact_release (
-	unsigned int handle);
+	hdb_handle_t handle);
 
 
 #endif /* LCR_IFACT_H_DEFINED */
 #endif /* LCR_IFACT_H_DEFINED */

+ 13 - 13
include/corosync/totem/coropoll.h

@@ -34,62 +34,62 @@
 #ifndef POLL_H_DEFINED
 #ifndef POLL_H_DEFINED
 #define POLL_H_DEFINED
 #define POLL_H_DEFINED
 
 
+#include <corosync/hdb.h>
 #include <pthread.h>
 #include <pthread.h>
 
 
 typedef void * poll_timer_handle;
 typedef void * poll_timer_handle;
-typedef unsigned int poll_handle;
 
 
-poll_handle poll_create (
+hdb_handle_t poll_create (
 	void (*serialize_lock) (void),
 	void (*serialize_lock) (void),
 	void (*serialize_unlock) (void));
 	void (*serialize_unlock) (void));
 
 
-int poll_destroy (poll_handle poll_handle);
+int poll_destroy (hdb_handle_t hdb_handle_t);
 
 
 int poll_dispatch_add (
 int poll_dispatch_add (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int fd,
 	int fd,
 	int events,
 	int events,
 	void *data,
 	void *data,
 
 
-	int (*dispatch_fn) (poll_handle handle,
+	int (*dispatch_fn) (hdb_handle_t handle,
 		int fd,
 		int fd,
 		int revents,
 		int revents,
 		void *data));
 		void *data));
 
 
 int poll_dispatch_modify (
 int poll_dispatch_modify (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int fd,
 	int fd,
 	int events,
 	int events,
 
 
-	int (*dispatch_fn) (poll_handle poll_handle,
+	int (*dispatch_fn) (hdb_handle_t hdb_handle_t,
 		int fd,
 		int fd,
 		int revents,
 		int revents,
 		void *data));
 		void *data));
 
 
 
 
 int poll_dispatch_delete (
 int poll_dispatch_delete (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int fd);
 	int fd);
 
 
 int poll_timer_add (
 int poll_timer_add (
-	poll_handle handle,
+	hdb_handle_t handle,
 	int msec_in_future, void *data,
 	int msec_in_future, void *data,
 	void (*timer_fn) (void *data),
 	void (*timer_fn) (void *data),
 	poll_timer_handle *timer_handle_out);
 	poll_timer_handle *timer_handle_out);
 
 
 int poll_timer_delete (
 int poll_timer_delete (
-	poll_handle handle,
+	hdb_handle_t handle,
 	poll_timer_handle timer_handle);
 	poll_timer_handle timer_handle);
 
 
 int poll_run (
 int poll_run (
-	poll_handle handle);
+	hdb_handle_t handle);
 
 
 int poll_stop (
 int poll_stop (
-	poll_handle handle);
+	hdb_handle_t handle);
 
 
 #ifdef COMPILE_OUT
 #ifdef COMPILE_OUT
 void poll_print_state (
 void poll_print_state (
-	poll_handle handle, int fd);
+	hdb_handle_t handle, int fd);
 #endif
 #endif
 
 
 #endif	/* POLL_H_DEFINED */
 #endif	/* POLL_H_DEFINED */

+ 10 - 11
include/corosync/totem/totempg.h

@@ -39,8 +39,7 @@
 #include <netinet/in.h>
 #include <netinet/in.h>
 #include "totem.h"
 #include "totem.h"
 #include "coropoll.h"
 #include "coropoll.h"
-
-typedef unsigned int totempg_groups_handle;
+#include <corosync/hdb.h>
 
 
 struct totempg_group {
 struct totempg_group {
 	void *group;
 	void *group;
@@ -59,7 +58,7 @@ struct totempg_group {
  * Initialize the totem process groups abstraction
  * Initialize the totem process groups abstraction
  */
  */
 extern int totempg_initialize (
 extern int totempg_initialize (
-	poll_handle poll_handle,
+	hdb_handle_t poll_handle,
 	struct totem_config *totem_config
 	struct totem_config *totem_config
 );
 );
 
 
@@ -77,7 +76,7 @@ extern void totempg_callback_token_destroy (void *handle);
  * Initialize a groups instance
  * Initialize a groups instance
  */
  */
 extern int totempg_groups_initialize (
 extern int totempg_groups_initialize (
-	totempg_groups_handle *handle,
+	hdb_handle_t *handle,
 
 
 	void (*deliver_fn) (
 	void (*deliver_fn) (
 		unsigned int nodeid,
 		unsigned int nodeid,
@@ -93,31 +92,31 @@ extern int totempg_groups_initialize (
 		struct memb_ring_id *ring_id));
 		struct memb_ring_id *ring_id));
 
 
 extern int totempg_groups_finalize (
 extern int totempg_groups_finalize (
-	totempg_groups_handle handle);
+	hdb_handle_t handle);
 
 
 extern int totempg_groups_join (
 extern int totempg_groups_join (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	struct totempg_group *groups,
 	struct totempg_group *groups,
 	int gruop_cnt);
 	int gruop_cnt);
 
 
 extern int totempg_groups_leave (
 extern int totempg_groups_leave (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	struct totempg_group *groups,
 	struct totempg_group *groups,
 	int gruop_cnt);
 	int gruop_cnt);
 
 
 extern int totempg_groups_mcast_joined (
 extern int totempg_groups_mcast_joined (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	int iov_len,
 	int iov_len,
 	int guarantee);
 	int guarantee);
 
 
 extern int totempg_groups_send_ok_joined (
 extern int totempg_groups_send_ok_joined (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	struct iovec *iovec,
 	struct iovec *iovec,
 	int iov_len);
 	int iov_len);
 	
 	
 extern int totempg_groups_mcast_groups (
 extern int totempg_groups_mcast_groups (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	int guarantee,
 	int guarantee,
 	struct totempg_group *groups,
 	struct totempg_group *groups,
 	int groups_cnt,
 	int groups_cnt,
@@ -125,7 +124,7 @@ extern int totempg_groups_mcast_groups (
 	int iov_len);
 	int iov_len);
 
 
 extern int totempg_groups_send_ok_groups (
 extern int totempg_groups_send_ok_groups (
-	totempg_groups_handle handle,
+	hdb_handle_t handle,
 	struct totempg_group *groups,
 	struct totempg_group *groups,
 	int groups_cnt,
 	int groups_cnt,
 	struct iovec *iovec,
 	struct iovec *iovec,

+ 8 - 7
lcr/lcr_ifact.c

@@ -38,6 +38,7 @@
 #ifdef COROSYNC_SOLARIS
 #ifdef COROSYNC_SOLARIS
 #include <iso/limits_iso.h>
 #include <iso/limits_iso.h>
 #endif
 #endif
+#include <corosync/hdb.h>
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/lcr/lcr_comp.h>
 #include <corosync/lcr/lcr_ifact.h>
 #include <corosync/lcr/lcr_ifact.h>
 #include <corosync/hdb.h>
 #include <corosync/hdb.h>
@@ -46,14 +47,14 @@
 struct lcr_component_instance {
 struct lcr_component_instance {
 	struct lcr_iface *ifaces;
 	struct lcr_iface *ifaces;
 	int iface_count;
 	int iface_count;
-	unsigned int comp_handle;
+	hdb_handle_t comp_handle;
 	void *dl_handle;
 	void *dl_handle;
 	int refcount;
 	int refcount;
 	char library_name[256];
 	char library_name[256];
 };
 };
 
 
 struct lcr_iface_instance {
 struct lcr_iface_instance {
-	unsigned int component_handle;
+	hdb_handle_t component_handle;
 	void *context;
 	void *context;
 	void (*destructor) (void *context);
 	void (*destructor) (void *context);
 };
 };
@@ -112,7 +113,7 @@ static inline struct lcr_component_instance *lcr_comp_find (
 {
 {
 	struct lcr_component_instance *instance;
 	struct lcr_component_instance *instance;
 	void *instance_p = NULL;
 	void *instance_p = NULL;
-	unsigned int component_handle = 0;
+	hdb_handle_t component_handle = 0;
 	int i;
 	int i;
 
 
 	/*
 	/*
@@ -143,7 +144,7 @@ static inline int lcr_lib_loaded (
 {
 {
 	struct lcr_component_instance *instance;
 	struct lcr_component_instance *instance;
 	void *instance_p = NULL;
 	void *instance_p = NULL;
-	unsigned int component_handle = 0;
+	hdb_handle_t component_handle = 0;
 
 
 	/*
 	/*
 	 * Try to find interface in already loaded component
 	 * Try to find interface in already loaded component
@@ -420,7 +421,7 @@ found:
 static unsigned int lcr_initialized = 0;
 static unsigned int lcr_initialized = 0;
 
 
 int lcr_ifact_reference (
 int lcr_ifact_reference (
-	unsigned int *iface_handle,
+	hdb_handle_t *iface_handle,
 	char *iface_name,
 	char *iface_name,
 	int version,
 	int version,
 	void **iface,
 	void **iface,
@@ -486,7 +487,7 @@ found:
 	return (0);
 	return (0);
 }
 }
 
 
-int lcr_ifact_release (unsigned int handle)
+int lcr_ifact_release (hdb_handle_t handle)
 {
 {
 	struct lcr_iface_instance *iface_instance;
 	struct lcr_iface_instance *iface_instance;
 	int res = 0;
 	int res = 0;
@@ -509,7 +510,7 @@ int lcr_ifact_release (unsigned int handle)
 void lcr_component_register (struct lcr_comp *comp)
 void lcr_component_register (struct lcr_comp *comp)
 {
 {
 	struct lcr_component_instance *instance;
 	struct lcr_component_instance *instance;
-	static unsigned int comp_handle;
+	static hdb_handle_t comp_handle;
 
 
 	hdb_handle_create (&lcr_component_instance_database,
 	hdb_handle_create (&lcr_component_instance_database,
 		sizeof (struct lcr_component_instance),
 		sizeof (struct lcr_component_instance),

+ 5 - 4
lcr/test.c

@@ -29,6 +29,7 @@
  */
  */
 #include <assert.h>
 #include <assert.h>
 #include <unistd.h>
 #include <unistd.h>
+#include <corosync/hdb.h>
 #include <corosync/lcr/lcr_ifact.h>
 #include <corosync/lcr/lcr_ifact.h>
 
 
 struct iface {
 struct iface {
@@ -38,15 +39,15 @@ struct iface {
 };
 };
 
 
 int main (void) {
 int main (void) {
-	unsigned int a_ifact_handle_ver0;
-	unsigned int b_ifact_handle_ver0;
+	hdb_handle_t a_ifact_handle_ver0;
+	hdb_handle_t b_ifact_handle_ver0;
 	struct iface *a_iface_ver0;
 	struct iface *a_iface_ver0;
 	struct iface *a_iface_ver1;
 	struct iface *a_iface_ver1;
 	void *a_iface_ver0_p;
 	void *a_iface_ver0_p;
 	void *a_iface_ver1_p;
 	void *a_iface_ver1_p;
 
 
-	unsigned int a_ifact_handle_ver1;
-	unsigned int b_ifact_handle_ver1;
+	hdb_handle_t a_ifact_handle_ver1;
+	hdb_handle_t b_ifact_handle_ver1;
 	struct iface *b_iface_ver0;
 	struct iface *b_iface_ver0;
 	struct iface *b_iface_ver1;
 	struct iface *b_iface_ver1;
 	void *b_iface_ver0_p;
 	void *b_iface_ver0_p;

+ 28 - 30
lib/confdb.c

@@ -56,9 +56,9 @@
    each object_handle can have its own iterator */
    each object_handle can have its own iterator */
 struct iter_context {
 struct iter_context {
 	struct list_head list;
 	struct list_head list;
-	uint32_t parent_object_handle;
-	uint32_t find_handle;
-	uint32_t next_entry;
+	hdb_handle_t parent_object_handle;
+	hdb_handle_t find_handle;
+	hdb_handle_t next_entry;
 };
 };
 
 
 struct confdb_inst {
 struct confdb_inst {
@@ -85,7 +85,7 @@ static struct saHandleDatabase confdb_handle_t_db = {
 };
 };
 
 
 
 
-static cs_error_t do_find_destroy(struct confdb_inst *confdb_inst, unsigned int find_handle);
+static cs_error_t do_find_destroy(struct confdb_inst *confdb_inst, hdb_handle_t find_handle);
 
 
 
 
 /* Safely tidy one iterator context list */
 /* Safely tidy one iterator context list */
@@ -114,7 +114,7 @@ static void confdb_instance_destructor (void *instance)
 	pthread_mutex_destroy (&confdb_inst->dispatch_mutex);
 	pthread_mutex_destroy (&confdb_inst->dispatch_mutex);
 }
 }
 
 
-static struct iter_context *find_iter_context(struct list_head *list, unsigned int object_handle)
+static struct iter_context *find_iter_context(struct list_head *list, hdb_handle_t object_handle)
 {
 {
 	struct iter_context *context;
 	struct iter_context *context;
 	struct list_head *iter;
 	struct list_head *iter;
@@ -292,7 +292,6 @@ cs_error_t confdb_dispatch (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
 	cs_dispatch_flags_t dispatch_types)
 	cs_dispatch_flags_t dispatch_types)
 {
 {
-	struct pollfd ufds;
 	int timeout = -1;
 	int timeout = -1;
 	cs_error_t error;
 	cs_error_t error;
 	int cont = 1; /* always continue do loop except when set to 0 */
 	int cont = 1; /* always continue do loop except when set to 0 */
@@ -338,7 +337,6 @@ cs_error_t confdb_dispatch (
 			goto error_put;
 			goto error_put;
 		}
 		}
 
 
-		dispatch_avail = ufds.revents & POLLIN;
 		if (dispatch_avail == 0 && dispatch_types == CONFDB_DISPATCH_ALL) {
 		if (dispatch_avail == 0 && dispatch_types == CONFDB_DISPATCH_ALL) {
 			break; /* exit do while cont is 1 loop */
 			break; /* exit do while cont is 1 loop */
 		} else
 		} else
@@ -421,10 +419,10 @@ error_noput:
 
 
 cs_error_t confdb_object_create (
 cs_error_t confdb_object_create (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *object_name,
 	void *object_name,
 	int object_name_len,
 	int object_name_len,
-	unsigned int *object_handle)
+	hdb_handle_t *object_handle)
 {
 {
 	cs_error_t error;
 	cs_error_t error;
 	struct confdb_inst *confdb_inst;
 	struct confdb_inst *confdb_inst;
@@ -481,7 +479,7 @@ error_exit:
 
 
 cs_error_t confdb_object_destroy (
 cs_error_t confdb_object_destroy (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int object_handle)
+	hdb_handle_t object_handle)
 {
 {
 	cs_error_t error;
 	cs_error_t error;
 	struct confdb_inst *confdb_inst;
 	struct confdb_inst *confdb_inst;
@@ -533,8 +531,8 @@ error_exit:
 
 
 cs_error_t confdb_object_parent_get (
 cs_error_t confdb_object_parent_get (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int object_handle,
-	unsigned int *parent_object_handle)
+	hdb_handle_t object_handle,
+	hdb_handle_t *parent_object_handle)
 {
 {
 	cs_error_t error;
 	cs_error_t error;
 	struct confdb_inst *confdb_inst;
 	struct confdb_inst *confdb_inst;
@@ -587,7 +585,7 @@ error_exit:
 
 
 static cs_error_t do_find_destroy(
 static cs_error_t do_find_destroy(
 	struct confdb_inst *confdb_inst,
 	struct confdb_inst *confdb_inst,
-	unsigned int find_handle)
+	hdb_handle_t find_handle)
 {
 {
 	cs_error_t error;
 	cs_error_t error;
 	struct iovec iov;
 	struct iovec iov;
@@ -635,7 +633,7 @@ error_exit:
 
 
 cs_error_t confdb_object_find_destroy(
 cs_error_t confdb_object_find_destroy(
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle)
+	hdb_handle_t parent_object_handle)
 {
 {
 	struct iter_context *context;
 	struct iter_context *context;
 	cs_error_t error;
 	cs_error_t error;
@@ -659,7 +657,7 @@ cs_error_t confdb_object_find_destroy(
 
 
 cs_error_t confdb_object_iter_destroy(
 cs_error_t confdb_object_iter_destroy(
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle)
+	hdb_handle_t parent_object_handle)
 {
 {
 	struct iter_context *context;
 	struct iter_context *context;
 	cs_error_t error;
 	cs_error_t error;
@@ -684,7 +682,7 @@ cs_error_t confdb_object_iter_destroy(
 
 
 cs_error_t confdb_key_create (
 cs_error_t confdb_key_create (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *value,
 	void *value,
@@ -746,7 +744,7 @@ error_exit:
 
 
 cs_error_t confdb_key_delete (
 cs_error_t confdb_key_delete (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *value,
 	void *value,
@@ -808,7 +806,7 @@ error_exit:
 
 
 cs_error_t confdb_key_get (
 cs_error_t confdb_key_get (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *value,
 	void *value,
@@ -872,7 +870,7 @@ error_exit:
 
 
 cs_error_t confdb_key_increment (
 cs_error_t confdb_key_increment (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	unsigned int *value)
 	unsigned int *value)
@@ -934,7 +932,7 @@ error_exit:
 
 
 cs_error_t confdb_key_decrement (
 cs_error_t confdb_key_decrement (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	unsigned int *value)
 	unsigned int *value)
@@ -996,7 +994,7 @@ error_exit:
 
 
 cs_error_t confdb_key_replace (
 cs_error_t confdb_key_replace (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *old_value,
 	void *old_value,
@@ -1062,7 +1060,7 @@ error_exit:
 
 
 cs_error_t confdb_object_iter_start (
 cs_error_t confdb_object_iter_start (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int object_handle)
+	hdb_handle_t object_handle)
 {
 {
 	struct confdb_inst *confdb_inst;
 	struct confdb_inst *confdb_inst;
 	cs_error_t error = CS_OK;
 	cs_error_t error = CS_OK;
@@ -1099,7 +1097,7 @@ ret:
 
 
 cs_error_t confdb_key_iter_start (
 cs_error_t confdb_key_iter_start (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int object_handle)
+	hdb_handle_t object_handle)
 {
 {
 	struct confdb_inst *confdb_inst;
 	struct confdb_inst *confdb_inst;
 	cs_error_t error = CS_OK;
 	cs_error_t error = CS_OK;
@@ -1132,7 +1130,7 @@ ret:
 
 
 cs_error_t confdb_object_find_start (
 cs_error_t confdb_object_find_start (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle)
+	hdb_handle_t parent_object_handle)
 {
 {
 	struct confdb_inst *confdb_inst;
 	struct confdb_inst *confdb_inst;
 	cs_error_t error = CS_OK;
 	cs_error_t error = CS_OK;
@@ -1168,10 +1166,10 @@ ret:
 
 
 cs_error_t confdb_object_find (
 cs_error_t confdb_object_find (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *object_name,
 	void *object_name,
 	int object_name_len,
 	int object_name_len,
-	unsigned int *object_handle)
+	hdb_handle_t *object_handle)
 {
 {
 	cs_error_t error;
 	cs_error_t error;
 	struct confdb_inst *confdb_inst;
 	struct confdb_inst *confdb_inst;
@@ -1241,8 +1239,8 @@ error_exit:
 
 
 cs_error_t confdb_object_iter (
 cs_error_t confdb_object_iter (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
-	unsigned int *object_handle,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t *object_handle,
 	void *object_name,
 	void *object_name,
 	int *object_name_len)
 	int *object_name_len)
 {
 {
@@ -1317,7 +1315,7 @@ error_exit:
 
 
 cs_error_t confdb_key_iter (
 cs_error_t confdb_key_iter (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int *key_name_len,
 	int *key_name_len,
 	void *value,
 	void *value,
@@ -1503,7 +1501,7 @@ error_exit:
 
 
 cs_error_t confdb_track_changes (
 cs_error_t confdb_track_changes (
 	confdb_handle_t handle,
 	confdb_handle_t handle,
-	unsigned int object_handle,
+	hdb_handle_t object_handle,
 	unsigned int flags)
 	unsigned int flags)
 {
 {
 	cs_error_t error;
 	cs_error_t error;

+ 20 - 20
lib/sa-confdb.c

@@ -60,7 +60,7 @@ static struct config_iface_ver0 *config_modules[128];
 
 
 static int load_objdb()
 static int load_objdb()
 {
 {
-	unsigned int objdb_handle;
+	hdb_handle_t objdb_handle;
 	void *objdb_p;
 	void *objdb_p;
 	int res;
 	int res;
 
 
@@ -88,8 +88,8 @@ static int load_config()
 	char *config_iface;
 	char *config_iface;
 	char *iface;
 	char *iface;
 	int res;
 	int res;
-	unsigned int config_handle;
-	unsigned int config_version = 0;
+	hdb_handle_t config_handle;
+	hdb_handle_t config_version = 0;
 	void *config_p;
 	void *config_p;
 	struct config_iface_ver0 *config;
 	struct config_iface_ver0 *config;
 	char *error_string;
 	char *error_string;
@@ -184,10 +184,10 @@ int confdb_sa_init (void)
 
 
 
 
 int confdb_sa_object_create (
 int confdb_sa_object_create (
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *object_name,
 	void *object_name,
 	int object_name_len,
 	int object_name_len,
-	unsigned int *object_handle)
+	hdb_handle_t *object_handle)
 {
 {
 	return objdb->object_create(parent_object_handle,
 	return objdb->object_create(parent_object_handle,
 				    object_handle,
 				    object_handle,
@@ -195,20 +195,20 @@ int confdb_sa_object_create (
 }
 }
 
 
 int confdb_sa_object_destroy (
 int confdb_sa_object_destroy (
-	unsigned int object_handle)
+	hdb_handle_t object_handle)
 {
 {
 	return objdb->object_destroy(object_handle);
 	return objdb->object_destroy(object_handle);
 }
 }
 
 
 int confdb_sa_object_parent_get (
 int confdb_sa_object_parent_get (
-	unsigned int object_handle,
-	unsigned int *parent_object_handle)
+	hdb_handle_t object_handle,
+	hdb_handle_t *parent_object_handle)
 {
 {
 	return objdb->object_parent_get(object_handle, parent_object_handle);
 	return objdb->object_parent_get(object_handle, parent_object_handle);
 }
 }
 
 
 int confdb_sa_key_create (
 int confdb_sa_key_create (
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *value,
 	void *value,
@@ -220,7 +220,7 @@ int confdb_sa_key_create (
 }
 }
 
 
 int confdb_sa_key_delete (
 int confdb_sa_key_delete (
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *value,
 	void *value,
@@ -232,7 +232,7 @@ int confdb_sa_key_delete (
 }
 }
 
 
 int confdb_sa_key_get (
 int confdb_sa_key_get (
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *value,
 	void *value,
@@ -251,7 +251,7 @@ int confdb_sa_key_get (
 }
 }
 
 
 int confdb_sa_key_increment (
 int confdb_sa_key_increment (
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	unsigned int *value)
 	unsigned int *value)
@@ -265,7 +265,7 @@ int confdb_sa_key_increment (
 }
 }
 
 
 int confdb_sa_key_decrement (
 int confdb_sa_key_decrement (
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	unsigned int *value)
 	unsigned int *value)
@@ -280,7 +280,7 @@ int confdb_sa_key_decrement (
 
 
 
 
 int confdb_sa_key_replace (
 int confdb_sa_key_replace (
-	unsigned int parent_object_handle,
+	hdb_handle_t parent_object_handle,
 	void *key_name,
 	void *key_name,
 	int key_name_len,
 	int key_name_len,
 	void *old_value,
 	void *old_value,
@@ -322,9 +322,9 @@ int confdb_sa_reload (
 }
 }
 
 
 int confdb_sa_object_find (
 int confdb_sa_object_find (
-	unsigned int parent_object_handle,
-	unsigned int *find_handle,
-	unsigned int *object_handle,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t *find_handle,
+	hdb_handle_t *object_handle,
 	void *object_name,
 	void *object_name,
 	int *object_name_len,
 	int *object_name_len,
 	int copy_name)
 	int copy_name)
@@ -348,8 +348,8 @@ int confdb_sa_object_find (
 }
 }
 
 
 int confdb_sa_key_iter (
 int confdb_sa_key_iter (
-	unsigned int parent_object_handle,
-	unsigned int start_pos,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t start_pos,
 	void *key_name,
 	void *key_name,
 	int *key_name_len,
 	int *key_name_len,
 	void *value,
 	void *value,
@@ -370,7 +370,7 @@ int confdb_sa_key_iter (
 	return res;
 	return res;
 }
 }
 
 
-int confdb_sa_find_destroy(unsigned int find_handle)
+int confdb_sa_find_destroy(hdb_handle_t find_handle)
 {
 {
 	return objdb->object_find_destroy(find_handle);
 	return objdb->object_find_destroy(find_handle);
 }
 }

+ 12 - 12
lib/sa-confdb.h

@@ -33,17 +33,17 @@
  */
  */
 
 
 extern int confdb_sa_init(void);
 extern int confdb_sa_init(void);
-extern int confdb_sa_object_create(unsigned int parent_object_handle, void *object_name, int object_name_len, unsigned int *object_handle);
-extern int confdb_sa_object_destroy(unsigned int object_handle);
-extern int confdb_sa_object_parent_get(unsigned int object_handle, unsigned int *parent_object_handle);
-extern int confdb_sa_key_create(unsigned int parent_object_handle, void *key_name, int key_name_len, void *value, int value_len);
-extern int confdb_sa_key_delete(unsigned int parent_object_handle, void *key_name, int key_name_len, void *value, int value_len);
-extern int confdb_sa_key_get(unsigned int parent_object_handle, void *key_name, int key_name_len, void *value, int *value_len);
-extern int confdb_sa_key_replace(unsigned int parent_object_handle, void *key_name, int key_name_len, void *old_value, int old_value_len, void *new_value, int new_value_len);
-extern int confdb_sa_object_find(unsigned int parent_object_handle, unsigned int *find_handle, unsigned int *object_handle, void *object_name, int *object_name_len, int copy_name);
-extern int confdb_sa_key_iter(unsigned int parent_object_handle, unsigned int start_pos, void *key_name, int *key_name_len, void *value, int *value_len);
-extern int confdb_sa_key_increment(unsigned int parent_object_handle, void *key_name, int key_name_len, unsigned int *value);
-extern int confdb_sa_key_decrement(unsigned int parent_object_handle, void *key_name, int key_name_len, unsigned int *value);
-extern int confdb_sa_find_destroy(unsigned int find_handle);
+extern int confdb_sa_object_create(hdb_handle_t parent_object_handle, void *object_name, int object_name_len, hdb_handle_t *object_handle);
+extern int confdb_sa_object_destroy(hdb_handle_t object_handle);
+extern int confdb_sa_object_parent_get(hdb_handle_t object_handle, hdb_handle_t *parent_object_handle);
+extern int confdb_sa_key_create(hdb_handle_t parent_object_handle, void *key_name, int key_name_len, void *value, int value_len);
+extern int confdb_sa_key_delete(hdb_handle_t parent_object_handle, void *key_name, int key_name_len, void *value, int value_len);
+extern int confdb_sa_key_get(hdb_handle_t parent_object_handle, void *key_name, int key_name_len, void *value, int *value_len);
+extern int confdb_sa_key_replace(hdb_handle_t parent_object_handle, void *key_name, int key_name_len, void *old_value, int old_value_len, void *new_value, int new_value_len);
+extern int confdb_sa_object_find(hdb_handle_t parent_object_handle, hdb_handle_t *find_handle, hdb_handle_t *object_handle, void *object_name, int *object_name_len, int copy_name);
+extern int confdb_sa_key_iter(hdb_handle_t parent_object_handle, hdb_handle_t start_pos, void *key_name, int *key_name_len, void *value, int *value_len);
+extern int confdb_sa_key_increment(hdb_handle_t parent_object_handle, void *key_name, int key_name_len, unsigned int *value);
+extern int confdb_sa_key_decrement(hdb_handle_t parent_object_handle, void *key_name, int key_name_len, unsigned int *value);
+extern int confdb_sa_find_destroy(hdb_handle_t find_handle);
 extern int confdb_sa_write(char *error_text);
 extern int confdb_sa_write(char *error_text);
 extern int confdb_sa_reload(int flush, char *error_text);
 extern int confdb_sa_reload(int flush, char *error_text);

+ 2 - 2
services/cfg.c

@@ -912,8 +912,8 @@ static void message_handler_req_lib_cfg_tryshutdown (
 		return;
 		return;
 	}
 	}
 	else {
 	else {
-		unsigned int cfg_handle;
-		unsigned int find_handle;
+		hdb_handle_t cfg_handle;
+		hdb_handle_t find_handle;
 		char *timeout_str;
 		char *timeout_str;
 		unsigned int shutdown_timeout = DEFAULT_SHUTDOWN_TIMEOUT;
 		unsigned int shutdown_timeout = DEFAULT_SHUTDOWN_TIMEOUT;
 
 

+ 27 - 22
services/confdb.c

@@ -82,21 +82,26 @@ static void message_handler_req_lib_confdb_reload (void *conn, void *message);
 static void message_handler_req_lib_confdb_track_start (void *conn, void *message);
 static void message_handler_req_lib_confdb_track_start (void *conn, void *message);
 static void message_handler_req_lib_confdb_track_stop (void *conn, void *message);
 static void message_handler_req_lib_confdb_track_stop (void *conn, void *message);
 
 
-static void confdb_notify_lib_of_key_change(object_change_type_t change_type,
-											unsigned int parent_object_handle,
-											unsigned int object_handle,
-											void *object_name_pt, int object_name_len,
-											void *key_name_pt, int key_name_len,
-											void *key_value_pt, int key_value_len,
-											void *priv_data_pt);
-
-static void confdb_notify_lib_of_new_object(unsigned int parent_object_handle,
-											unsigned int object_handle,
-											uint8_t *name_pt, int name_len,
-											void *priv_data_pt);
-static void confdb_notify_lib_of_destroyed_object(unsigned int parent_object_handle,
-												  uint8_t *name_pt, int name_len,
-												  void *priv_data_pt);
+static void confdb_notify_lib_of_key_change(
+	object_change_type_t change_type,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
+	void *object_name_pt, int object_name_len,
+	void *key_name_pt, int key_name_len,
+	void *key_value_pt, int key_value_len,
+	void *priv_data_pt);
+
+static void confdb_notify_lib_of_new_object(
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
+	uint8_t *name_pt, int name_len,
+	void *priv_data_pt);
+
+static void confdb_notify_lib_of_destroyed_object(
+	hdb_handle_t parent_object_handle,
+	uint8_t *name_pt, int name_len,
+	void *priv_data_pt);
+
 /*
 /*
  * Library Handler Definition
  * Library Handler Definition
  */
  */
@@ -289,7 +294,7 @@ static void message_handler_req_lib_confdb_object_create (void *conn, void *mess
 {
 {
 	struct req_lib_confdb_object_create *req_lib_confdb_object_create = (struct req_lib_confdb_object_create *)message;
 	struct req_lib_confdb_object_create *req_lib_confdb_object_create = (struct req_lib_confdb_object_create *)message;
 	struct res_lib_confdb_object_create res_lib_confdb_object_create;
 	struct res_lib_confdb_object_create res_lib_confdb_object_create;
-	unsigned int object_handle;
+	hdb_handle_t object_handle;
 	int ret = CS_OK;
 	int ret = CS_OK;
 
 
 	if (api->object_create(req_lib_confdb_object_create->parent_object_handle,
 	if (api->object_create(req_lib_confdb_object_create->parent_object_handle,
@@ -460,7 +465,7 @@ static void message_handler_req_lib_confdb_object_parent_get (void *conn, void *
 {
 {
 	struct req_lib_confdb_object_parent_get *req_lib_confdb_object_parent_get = (struct req_lib_confdb_object_parent_get *)message;
 	struct req_lib_confdb_object_parent_get *req_lib_confdb_object_parent_get = (struct req_lib_confdb_object_parent_get *)message;
 	struct res_lib_confdb_object_parent_get res_lib_confdb_object_parent_get;
 	struct res_lib_confdb_object_parent_get res_lib_confdb_object_parent_get;
-	unsigned int object_handle;
+	hdb_handle_t object_handle;
 	int ret = CS_OK;
 	int ret = CS_OK;
 
 
 	if (api->object_parent_get(req_lib_confdb_object_parent_get->object_handle,
 	if (api->object_parent_get(req_lib_confdb_object_parent_get->object_handle,
@@ -613,8 +618,8 @@ static void message_handler_req_lib_confdb_reload (void *conn, void *message)
 }
 }
 
 
 static void confdb_notify_lib_of_key_change(object_change_type_t change_type,
 static void confdb_notify_lib_of_key_change(object_change_type_t change_type,
-											  unsigned int parent_object_handle,
-											  unsigned int object_handle,
+											  hdb_handle_t parent_object_handle,
+											  hdb_handle_t object_handle,
 											  void *object_name_pt, int object_name_len,
 											  void *object_name_pt, int object_name_len,
 											  void *key_name_pt, int key_name_len,
 											  void *key_name_pt, int key_name_len,
 											  void *key_value_pt, int key_value_len,
 											  void *key_value_pt, int key_value_len,
@@ -642,8 +647,8 @@ static void confdb_notify_lib_of_key_change(object_change_type_t change_type,
 	api->ipc_dispatch_send(priv_data_pt, &res, sizeof(res));
 	api->ipc_dispatch_send(priv_data_pt, &res, sizeof(res));
 }
 }
 
 
-static void confdb_notify_lib_of_new_object(unsigned int parent_object_handle,
-										   unsigned int object_handle,
+static void confdb_notify_lib_of_new_object(hdb_handle_t parent_object_handle,
+										   hdb_handle_t object_handle,
 										   uint8_t *name_pt, int name_len,
 										   uint8_t *name_pt, int name_len,
 										   void *priv_data_pt)
 										   void *priv_data_pt)
 {
 {
@@ -660,7 +665,7 @@ static void confdb_notify_lib_of_new_object(unsigned int parent_object_handle,
 	api->ipc_dispatch_send(priv_data_pt, &res, sizeof(res));
 	api->ipc_dispatch_send(priv_data_pt, &res, sizeof(res));
 }
 }
 
 
-static void confdb_notify_lib_of_destroyed_object(unsigned int parent_object_handle,
+static void confdb_notify_lib_of_destroyed_object(hdb_handle_t parent_object_handle,
 											uint8_t *name_pt, int name_len,
 											uint8_t *name_pt, int name_len,
 											void *priv_data_pt)
 											void *priv_data_pt)
 {
 {

+ 4 - 4
services/testquorum.c

@@ -101,8 +101,8 @@ __attribute__ ((constructor)) static void test_quorum_comp_register (void) {
 static quorum_set_quorate_fn_t set_quorum;
 static quorum_set_quorate_fn_t set_quorum;
 
 
 static void key_change_notify(object_change_type_t change_type,
 static void key_change_notify(object_change_type_t change_type,
-			      unsigned int parent_object_handle,
-			      unsigned int object_handle,
+			      hdb_handle_t parent_object_handle,
+			      hdb_handle_t object_handle,
 			      void *object_name_pt, int object_name_len,
 			      void *object_name_pt, int object_name_len,
 			      void *key_name_pt, int key_len,
 			      void *key_name_pt, int key_len,
 			      void *key_value_pt, int key_value_len,
 			      void *key_value_pt, int key_value_len,
@@ -128,8 +128,8 @@ static void test_init(struct corosync_api_v1 *api,
 		      quorum_set_quorate_fn_t report)
 		      quorum_set_quorate_fn_t report)
 {
 {
 
 
-	unsigned int find_handle;
-	unsigned int quorum_handle = 0;
+	hdb_handle_t find_handle;
+	hdb_handle_t quorum_handle = 0;
 
 
 	set_quorum = report;
 	set_quorum = report;
 
 

+ 10 - 10
services/votequorum.c

@@ -139,7 +139,7 @@ static struct list_head trackers_list;
 static unsigned int quorum_members[PROCESSOR_COUNT_MAX+1];
 static unsigned int quorum_members[PROCESSOR_COUNT_MAX+1];
 static int quorum_members_entries = 0;
 static int quorum_members_entries = 0;
 static struct memb_ring_id quorum_ringid;
 static struct memb_ring_id quorum_ringid;
-static cs_tpg_handle group_handle;
+static hdb_handle_t group_handle;
 
 
 #define max(a,b) (((a) > (b)) ? (a) : (b))
 #define max(a,b) (((a) > (b)) ? (a) : (b))
 static struct cluster_node *find_node_by_nodeid(int nodeid);
 static struct cluster_node *find_node_by_nodeid(int nodeid);
@@ -221,7 +221,7 @@ static int quorum_exec_send_nodeinfo(void);
 static int quorum_exec_send_reconfigure(int param, int nodeid, int value);
 static int quorum_exec_send_reconfigure(int param, int nodeid, int value);
 static int quorum_exec_send_killnode(int nodeid, unsigned int reason);
 static int quorum_exec_send_killnode(int nodeid, unsigned int reason);
 
 
-static void add_votequorum_config_notification(unsigned int quorum_object_handle);
+static void add_votequorum_config_notification(hdb_handle_t quorum_object_handle);
 
 
 
 
 /*
 /*
@@ -516,8 +516,8 @@ static void read_quorum_config(unsigned int quorum_handle)
 
 
 static int votequorum_exec_init_fn (struct corosync_api_v1 *api)
 static int votequorum_exec_init_fn (struct corosync_api_v1 *api)
 {
 {
-	unsigned int object_handle;
-	unsigned int find_handle;
+	hdb_handle_t object_handle;
+	hdb_handle_t find_handle;
 
 
 	ENTER();
 	ENTER();
 
 
@@ -1560,7 +1560,7 @@ static char *kill_reason(int reason)
 	}
 	}
 }
 }
 
 
-static void reread_config(unsigned int object_handle)
+static void reread_config(hdb_handle_t object_handle)
 {
 {
 	unsigned int old_votes;
 	unsigned int old_votes;
 	unsigned int old_expected;
 	unsigned int old_expected;
@@ -1585,8 +1585,8 @@ static void reread_config(unsigned int object_handle)
 }
 }
 
 
 static void quorum_key_change_notify(object_change_type_t change_type,
 static void quorum_key_change_notify(object_change_type_t change_type,
-				     unsigned int parent_object_handle,
-				     unsigned int object_handle,
+				     hdb_handle_t parent_object_handle,
+				     hdb_handle_t object_handle,
 				     void *object_name_pt, int object_name_len,
 				     void *object_name_pt, int object_name_len,
 				     void *key_name_pt, int key_len,
 				     void *key_name_pt, int key_len,
 				     void *key_value_pt, int key_value_len,
 				     void *key_value_pt, int key_value_len,
@@ -1620,8 +1620,8 @@ static void votequorum_objdb_reload_notify(
 
 
 	if (type == OBJDB_RELOAD_NOTIFY_END ||
 	if (type == OBJDB_RELOAD_NOTIFY_END ||
 	    type == OBJDB_RELOAD_NOTIFY_FAILED) {
 	    type == OBJDB_RELOAD_NOTIFY_FAILED) {
-		unsigned int find_handle;
-		unsigned int object_handle;
+		hdb_handle_t find_handle;
+		hdb_handle_t object_handle;
 
 
 		corosync_api->object_find_create(OBJECT_PARENT_HANDLE, "quorum", strlen("quorum"), &find_handle);
 		corosync_api->object_find_create(OBJECT_PARENT_HANDLE, "quorum", strlen("quorum"), &find_handle);
 		if (corosync_api->object_find_next(find_handle, &object_handle) == 0) {
 		if (corosync_api->object_find_next(find_handle, &object_handle) == 0) {
@@ -1637,7 +1637,7 @@ static void votequorum_objdb_reload_notify(
 
 
 
 
 static void add_votequorum_config_notification(
 static void add_votequorum_config_notification(
-	unsigned int quorum_object_handle)
+	hdb_handle_t quorum_object_handle)
 {
 {
 
 
 	corosync_api->object_track_start(quorum_object_handle,
 	corosync_api->object_track_start(quorum_object_handle,

+ 6 - 6
test/testconfdb.c

@@ -56,7 +56,7 @@ confdb_callbacks_t callbacks = {
 /* Recursively dump the object tree */
 /* Recursively dump the object tree */
 static void print_config_tree(confdb_handle_t handle, unsigned int parent_object_handle, int depth)
 static void print_config_tree(confdb_handle_t handle, unsigned int parent_object_handle, int depth)
 {
 {
-	unsigned int object_handle;
+	hdb_handle_t object_handle;
 	char object_name[1024];
 	char object_name[1024];
 	int object_name_len;
 	int object_name_len;
 	char key_name[1024];
 	char key_name[1024];
@@ -89,18 +89,18 @@ static void print_config_tree(confdb_handle_t handle, unsigned int parent_object
 	}
 	}
 
 
 	while ( (res = confdb_object_iter(handle, parent_object_handle, &object_handle, object_name, &object_name_len)) == CS_OK)	{
 	while ( (res = confdb_object_iter(handle, parent_object_handle, &object_handle, object_name, &object_name_len)) == CS_OK)	{
-		unsigned int parent;
+		hdb_handle_t parent;
 
 
 		res = confdb_object_parent_get(handle, object_handle, &parent);
 		res = confdb_object_parent_get(handle, object_handle, &parent);
 		if (res != CS_OK) {
 		if (res != CS_OK) {
-			printf( "error getting parent for object %d: %d\n", object_handle, res);
+			printf( "error getting parent for object %lld: %d\n", object_handle, res);
 			return;
 			return;
 		}
 		}
 
 
 		for (i=0; i<depth; i++)	printf("  ");
 		for (i=0; i<depth; i++)	printf("  ");
 
 
 		object_name[object_name_len] = '\0';
 		object_name[object_name_len] = '\0';
-		printf("OBJECT: %s (%u, parent: %u)\n", object_name, object_handle, parent);
+		printf("OBJECT: %s (%llu, parent: %llu)\n", object_name, object_handle, parent);
 
 
 		/* Down we go ... */
 		/* Down we go ... */
 		print_config_tree(handle, object_handle, depth+1);
 		print_config_tree(handle, object_handle, depth+1);
@@ -111,7 +111,7 @@ static void do_write_tests(confdb_handle_t handle)
 {
 {
 	int res;
 	int res;
 	unsigned int incdec_value;
 	unsigned int incdec_value;
-	unsigned int object_handle;
+	hdb_handle_t object_handle;
 	char error_string[1024];
 	char error_string[1024];
 
 
 	/* Add a scratch object and put some keys into it */
 	/* Add a scratch object and put some keys into it */
@@ -194,7 +194,7 @@ static void do_write_tests(confdb_handle_t handle)
 int main (int argc, char *argv[]) {
 int main (int argc, char *argv[]) {
 	confdb_handle_t handle;
 	confdb_handle_t handle;
 	int result;
 	int result;
-	unsigned int totem_handle;
+	hdb_handle_t totem_handle;
 	char key_value[256];
 	char key_value[256];
 	int value_len;
 	int value_len;
 
 

+ 49 - 49
tools/corosync-objctl.c

@@ -66,26 +66,26 @@ typedef enum {
 } find_object_of_type_t;
 } find_object_of_type_t;
 
 
 static void tail_key_changed(confdb_handle_t handle,
 static void tail_key_changed(confdb_handle_t handle,
-							   confdb_change_type_t change_type,
-							   unsigned int parent_object_handle,
-							   unsigned int object_handle,
-							   void *object_name,
-							   int  object_name_len,
-							   void *key_name,
-							   int key_name_len,
-							   void *key_value,
-							   int key_value_len);
+	confdb_change_type_t change_type,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
+	void *object_name,
+	int  object_name_len,
+	void *key_name,
+	int key_name_len,
+	void *key_value,
+	int key_value_len);
 
 
 static void tail_object_created(confdb_handle_t handle,
 static void tail_object_created(confdb_handle_t handle,
-								unsigned int parent_object_handle,
-								unsigned int object_handle,
-								uint8_t *name_pt,
-								int  name_len);
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
+	uint8_t *name_pt,
+	int  name_len);
 
 
 static void tail_object_deleted(confdb_handle_t handle,
 static void tail_object_deleted(confdb_handle_t handle,
-								unsigned int parent_object_handle,
-								uint8_t *name_pt,
-								int  name_len);
+	hdb_handle_t parent_object_handle,
+	uint8_t *name_pt,
+	int  name_len);
 
 
 confdb_callbacks_t callbacks = {
 confdb_callbacks_t callbacks = {
 	.confdb_key_change_notify_fn = tail_key_changed,
 	.confdb_key_change_notify_fn = tail_key_changed,
@@ -96,9 +96,9 @@ confdb_callbacks_t callbacks = {
 static int action;
 static int action;
 
 
 /* Recursively dump the object tree */
 /* Recursively dump the object tree */
-static void print_config_tree(confdb_handle_t handle, unsigned int parent_object_handle, char * parent_name)
+static void print_config_tree(confdb_handle_t handle, hdb_handle_t parent_object_handle, char * parent_name)
 {
 {
-	unsigned int object_handle;
+	hdb_handle_t object_handle;
 	char object_name[OBJ_NAME_SIZE];
 	char object_name[OBJ_NAME_SIZE];
 	int object_name_len;
 	int object_name_len;
 	char key_name[OBJ_NAME_SIZE];
 	char key_name[OBJ_NAME_SIZE];
@@ -111,7 +111,7 @@ static void print_config_tree(confdb_handle_t handle, unsigned int parent_object
 	/* Show the keys */
 	/* Show the keys */
 	res = confdb_key_iter_start(handle, parent_object_handle);
 	res = confdb_key_iter_start(handle, parent_object_handle);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		fprintf(stderr, "error resetting key iterator for object %d: %d\n", parent_object_handle, res);
+		fprintf(stderr, "error resetting key iterator for object %llu: %d\n", parent_object_handle, res);
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 	children_printed = 0;
 	children_printed = 0;
@@ -135,15 +135,15 @@ static void print_config_tree(confdb_handle_t handle, unsigned int parent_object
 	/* Show sub-objects */
 	/* Show sub-objects */
 	res = confdb_object_iter_start(handle, parent_object_handle);
 	res = confdb_object_iter_start(handle, parent_object_handle);
 	if (res != CS_OK) {
 	if (res != CS_OK) {
-		fprintf(stderr, "error resetting object iterator for object %d: %d\n", parent_object_handle, res);
+		fprintf(stderr, "error resetting object iterator for object %llu: %d\n", parent_object_handle, res);
 		exit(EXIT_FAILURE);
 		exit(EXIT_FAILURE);
 	}
 	}
 
 
 	while ( (res = confdb_object_iter(handle,
 	while ( (res = confdb_object_iter(handle,
-									  parent_object_handle,
-									  &object_handle,
-									  object_name,
-									  &object_name_len)) == CS_OK)	{
+		parent_object_handle,
+		&object_handle,
+		object_name,
+		&object_name_len)) == CS_OK)	{
 
 
 		object_name[object_name_len] = '\0';
 		object_name[object_name_len] = '\0';
 		if (parent_name != NULL) {
 		if (parent_name != NULL) {
@@ -256,11 +256,11 @@ void get_key(char * name_pt, char * key_name, char * key_value)
 static cs_error_t find_object (confdb_handle_t handle,
 static cs_error_t find_object (confdb_handle_t handle,
 			char * name_pt,
 			char * name_pt,
 			find_object_of_type_t type,
 			find_object_of_type_t type,
-			uint32_t * out_handle)
+			hdb_handle_t * out_handle)
 {
 {
 	char * obj_name_pt;
 	char * obj_name_pt;
 	char * save_pt;
 	char * save_pt;
-	uint32_t obj_handle;
+	hdb_handle_t obj_handle;
 	confdb_handle_t parent_object_handle = OBJECT_PARENT_HANDLE;
 	confdb_handle_t parent_object_handle = OBJECT_PARENT_HANDLE;
 	char tmp_name[OBJ_NAME_SIZE];
 	char tmp_name[OBJ_NAME_SIZE];
 	cs_error_t res;
 	cs_error_t res;
@@ -292,7 +292,7 @@ static cs_error_t find_object (confdb_handle_t handle,
 static void read_object(confdb_handle_t handle, char * name_pt)
 static void read_object(confdb_handle_t handle, char * name_pt)
 {
 {
 	char parent_name[OBJ_NAME_SIZE];
 	char parent_name[OBJ_NAME_SIZE];
-	uint32_t obj_handle;
+	hdb_handle_t obj_handle;
 	cs_error_t res;
 	cs_error_t res;
 
 
 	get_parent_name(name_pt, parent_name);
 	get_parent_name(name_pt, parent_name);
@@ -304,7 +304,7 @@ static void read_object(confdb_handle_t handle, char * name_pt)
 
 
 static void write_key(confdb_handle_t handle, char * path_pt)
 static void write_key(confdb_handle_t handle, char * path_pt)
 {
 {
-	uint32_t obj_handle;
+	hdb_handle_t obj_handle;
 	char parent_name[OBJ_NAME_SIZE];
 	char parent_name[OBJ_NAME_SIZE];
 	char key_name[OBJ_NAME_SIZE];
 	char key_name[OBJ_NAME_SIZE];
 	char key_value[OBJ_NAME_SIZE];
 	char key_value[OBJ_NAME_SIZE];
@@ -366,8 +366,8 @@ static void create_object(confdb_handle_t handle, char * name_pt)
 {
 {
 	char * obj_name_pt;
 	char * obj_name_pt;
 	char * save_pt;
 	char * save_pt;
-	uint32_t obj_handle;
-	uint32_t parent_object_handle = OBJECT_PARENT_HANDLE;
+	hdb_handle_t obj_handle;
+	hdb_handle_t parent_object_handle = OBJECT_PARENT_HANDLE;
 	char tmp_name[OBJ_NAME_SIZE];
 	char tmp_name[OBJ_NAME_SIZE];
 	cs_error_t res;
 	cs_error_t res;
 
 
@@ -382,7 +382,7 @@ static void create_object(confdb_handle_t handle, char * name_pt)
 		}
 		}
 
 
 		res = confdb_object_find(handle, parent_object_handle,
 		res = confdb_object_find(handle, parent_object_handle,
-								 obj_name_pt, strlen (obj_name_pt), &obj_handle);
+			 obj_name_pt, strlen (obj_name_pt), &obj_handle);
 		if (res != CS_OK) {
 		if (res != CS_OK) {
 
 
 			if (validate_name(obj_name_pt) != CS_OK) {
 			if (validate_name(obj_name_pt) != CS_OK) {
@@ -406,15 +406,15 @@ static void create_object(confdb_handle_t handle, char * name_pt)
 }
 }
 
 
 static void tail_key_changed(confdb_handle_t handle,
 static void tail_key_changed(confdb_handle_t handle,
-							   confdb_change_type_t change_type,
-							   unsigned int parent_object_handle,
-							   unsigned int object_handle,
-							   void *object_name_pt,
-							   int  object_name_len,
-							   void *key_name_pt,
-							   int key_name_len,
-							   void *key_value_pt,
-							   int key_value_len)
+	confdb_change_type_t change_type,
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
+	void *object_name_pt,
+	int  object_name_len,
+	void *key_name_pt,
+	int key_name_len,
+	void *key_value_pt,
+	int key_value_len)
 {
 {
 	char * on = (char*)object_name_pt;
 	char * on = (char*)object_name_pt;
 	char * kn = (char*)key_name_pt;
 	char * kn = (char*)key_name_pt;
@@ -427,19 +427,19 @@ static void tail_key_changed(confdb_handle_t handle,
 }
 }
 
 
 static void tail_object_created(confdb_handle_t handle,
 static void tail_object_created(confdb_handle_t handle,
-								unsigned int parent_object_handle,
-								unsigned int object_handle,
-								uint8_t *name_pt,
-								int  name_len)
+	hdb_handle_t parent_object_handle,
+	hdb_handle_t object_handle,
+	uint8_t *name_pt,
+	int  name_len)
 {
 {
 	name_pt[name_len] = '\0';
 	name_pt[name_len] = '\0';
 	printf("object_created> %s\n", name_pt);
 	printf("object_created> %s\n", name_pt);
 }
 }
 
 
 static void tail_object_deleted(confdb_handle_t handle,
 static void tail_object_deleted(confdb_handle_t handle,
-								unsigned int parent_object_handle,
-								uint8_t *name_pt,
-								int  name_len)
+	hdb_handle_t parent_object_handle,
+	uint8_t *name_pt,
+	int  name_len)
 {
 {
 	name_pt[name_len] = '\0';
 	name_pt[name_len] = '\0';
 
 
@@ -487,7 +487,7 @@ static void listen_for_object_changes(confdb_handle_t handle)
 static void track_object(confdb_handle_t handle, char * name_pt)
 static void track_object(confdb_handle_t handle, char * name_pt)
 {
 {
 	cs_error_t res;
 	cs_error_t res;
-	uint32_t obj_handle;
+	hdb_handle_t obj_handle;
 
 
 	res = find_object (handle, name_pt, FIND_OBJECT_ONLY, &obj_handle);
 	res = find_object (handle, name_pt, FIND_OBJECT_ONLY, &obj_handle);
 
 
@@ -519,7 +519,7 @@ static void stop_tracking(confdb_handle_t handle)
 static void delete_object(confdb_handle_t handle, char * name_pt)
 static void delete_object(confdb_handle_t handle, char * name_pt)
 {
 {
 	cs_error_t res;
 	cs_error_t res;
-	uint32_t obj_handle;
+	hdb_handle_t obj_handle;
 	res = find_object (handle, name_pt, FIND_OBJECT_ONLY, &obj_handle);
 	res = find_object (handle, name_pt, FIND_OBJECT_ONLY, &obj_handle);
 
 
 	if (res == CS_OK) {
 	if (res == CS_OK) {