public inbox for cluster-cvs@sourceware.org
help / color / mirror / Atom feed
* cluster: STABLE3 - misc: port the whole stack to the new corosync API
@ 2009-04-27 8:49 Fabio M. Di Nitto
0 siblings, 0 replies; only message in thread
From: Fabio M. Di Nitto @ 2009-04-27 8:49 UTC (permalink / raw)
To: cluster-cvs-relay
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=1b815e931c508ae0029a787f20b5aa15ec50ee14
Commit: 1b815e931c508ae0029a787f20b5aa15ec50ee14
Parent: 9e43ca654435e9207c35eca0b124caf8cb7e13d0
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Mon Apr 27 10:47:50 2009 +0200
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Mon Apr 27 10:47:50 2009 +0200
misc: port the whole stack to the new corosync API
This patch is based on the original cman port from Chrissie.
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
cman/daemon/ais.c | 36 ++++++++++++++-----------
cman/daemon/barrier.c | 8 ++++-
cman/daemon/cman-preconfig.c | 8 +++---
cman/daemon/cmanconfig.c | 8 ++++-
cman/daemon/commands.c | 16 +++++++----
cman/daemon/commands.h | 6 ++--
cman/daemon/daemon.c | 8 ++++-
cman/daemon/logging.c | 6 ++--
cman/daemon/logging.h | 8 +++---
config/libs/libccsconfdb/fullxpath.c | 4 +--
config/libs/libccsconfdb/libccs.c | 20 ++++++++------
config/libs/libccsconfdb/xpathlite.c | 6 ++--
config/tools/ldap/confdb2ldif.c | 6 ++--
fence/fenced/cpg.c | 47 ++++++++++++++++++++++-----------
group/daemon/cpg.c | 18 ++++++++----
group/dlm_controld/cpg.c | 47 ++++++++++++++++++++++-----------
group/dlm_controld/deadlock.c | 6 ++--
group/dlm_controld/dlm_daemon.h | 6 ++--
group/gfs_controld/cpg-new.c | 47 ++++++++++++++++++++++-----------
group/gfs_controld/cpg-old.c | 44 ++++++++++++++++++-------------
group/gfs_controld/gfs_daemon.h | 2 +-
21 files changed, 217 insertions(+), 140 deletions(-)
diff --git a/cman/daemon/ais.c b/cman/daemon/ais.c
index 1fbbc76..c40541b 100644
--- a/cman/daemon/ais.c
+++ b/cman/daemon/ais.c
@@ -16,7 +16,11 @@
/* corosync headers */
#include <corosync/corotypes.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcc.h>
+#include <corosync/corodefs.h>
+#include <corosync/mar_gen.h>
#include <corosync/engine/coroapi.h>
#include <corosync/engine/logsys.h>
#include <corosync/engine/quorum.h>
@@ -62,7 +66,7 @@ static struct corosync_tpg_group cman_group[1] = {
{ .group = "CMAN", .group_len = 4},
};
-LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME);
/* This structure is tacked onto the start of a cluster message packet for our
* own nefarious purposes. */
@@ -82,11 +86,11 @@ struct cl_protheader {
static int cman_exit_fn(void *conn_info);
static int cman_exec_init_fn(struct corosync_api_v1 *api);
static void cman_confchg_fn(enum totem_configuration_type configuration_type,
- unsigned int *member_list, int member_list_entries,
- unsigned int *left_list, int left_list_entries,
- unsigned int *joined_list, int joined_list_entries,
- struct memb_ring_id *ring_id);
-static void cman_deliver_fn(unsigned int nodeid, struct iovec *iovec, int iov_len,
+ const unsigned int *member_list, size_t member_list_entries,
+ const unsigned int *left_list, size_t left_list_entries,
+ const unsigned int *joined_list, size_t joined_list_entries,
+ const struct memb_ring_id *ring_id);
+static void cman_deliver_fn(unsigned int nodeid, const struct iovec *iovec, unsigned int iov_len,
int endian_conversion_required);
static void cman_quorum_init(struct corosync_api_v1 *api, quorum_set_quorate_fn_t report);
@@ -246,7 +250,7 @@ int comms_send_message(void *buf, int len,
}
// This assumes the iovec has only one element ... is it true ??
-static void cman_deliver_fn(unsigned int nodeid, struct iovec *iovec, int iov_len,
+static void cman_deliver_fn(unsigned int nodeid, const struct iovec *iovec, unsigned int iov_len,
int endian_conversion_required)
{
struct cl_protheader *header = iovec->iov_base;
@@ -272,15 +276,15 @@ static void cman_deliver_fn(unsigned int nodeid, struct iovec *iovec, int iov_le
}
static void cman_confchg_fn(enum totem_configuration_type configuration_type,
- unsigned int *member_list, int member_list_entries,
- unsigned int *left_list, int left_list_entries,
- unsigned int *joined_list, int joined_list_entries,
- struct memb_ring_id *ring_id)
+ const unsigned int *member_list, size_t member_list_entries,
+ const unsigned int *left_list, size_t left_list_entries,
+ const unsigned int *joined_list, size_t joined_list_entries,
+ const struct memb_ring_id *ring_id)
{
int i;
static int last_memb_count = 0;
- static int saved_left_list_entries;
- static int saved_left_list_size;
+ static size_t saved_left_list_entries;
+ static size_t saved_left_list_size;
static unsigned int *saved_left_list = NULL;
P_AIS("confchg_fn called type = %d, seq=%lld\n", configuration_type, ring_id->seq);
@@ -303,7 +307,7 @@ static void cman_confchg_fn(enum totem_configuration_type configuration_type,
saved_left_list_size = left_list_entries*2;
saved_left_list = malloc(sizeof(int) * saved_left_list_size);
if (!saved_left_list) {
- log_printf(LOG_LEVEL_CRIT, "cannot allocate memory for confchg message");
+ log_printf(LOGSYS_LEVEL_CRIT, "cannot allocate memory for confchg message");
exit(3);
}
}
@@ -311,7 +315,7 @@ static void cman_confchg_fn(enum totem_configuration_type configuration_type,
saved_left_list_size = left_list_entries*2;
saved_left_list = realloc(saved_left_list, sizeof(int) * saved_left_list_size);
if (!saved_left_list) {
- log_printf(LOG_LEVEL_CRIT, "cannot reallocate memory for confchg message");
+ log_printf(LOGSYS_LEVEL_CRIT, "cannot reallocate memory for confchg message");
exit(3);
}
}
diff --git a/cman/daemon/barrier.c b/cman/daemon/barrier.c
index 54df19a..1f414aa 100644
--- a/cman/daemon/barrier.c
+++ b/cman/daemon/barrier.c
@@ -16,7 +16,11 @@
#include <netinet/in.h>
#include <sys/errno.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcc.h>
+#include <corosync/corodefs.h>
+#include <corosync/mar_gen.h>
#include <corosync/engine/coroapi.h>
#include <corosync/engine/logsys.h>
#include "list.h"
@@ -31,7 +35,7 @@
extern int we_are_a_cluster_member;
-LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME);
/* A barrier */
struct cl_barrier {
diff --git a/cman/daemon/cman-preconfig.c b/cman/daemon/cman-preconfig.c
index a7bf92f..5af4437 100644
--- a/cman/daemon/cman-preconfig.c
+++ b/cman/daemon/cman-preconfig.c
@@ -398,7 +398,7 @@ static int verify_nodename(struct objdb_iface_ver0 *objdb, char *nodename)
return -1;
for (ifa = ifa_list; ifa; ifa = ifa->ifa_next) {
- socklen_t salen;
+ socklen_t salen = 0;
/* Restore this */
strcpy(nodename2, nodename);
@@ -964,11 +964,11 @@ static int copy_config_tree(struct objdb_iface_ver0 *objdb, hdb_handle_t source_
hdb_handle_t new_object;
hdb_handle_t find_handle;
char object_name[1024];
- int object_name_len;
+ size_t object_name_len;
void *key_name;
- int key_name_len;
+ size_t key_name_len;
void *key_value;
- int key_value_len;
+ size_t key_value_len;
int res;
/* Create new parent object if necessary */
diff --git a/cman/daemon/cmanconfig.c b/cman/daemon/cmanconfig.c
index eac221a..ed2dd90 100644
--- a/cman/daemon/cmanconfig.c
+++ b/cman/daemon/cmanconfig.c
@@ -7,7 +7,11 @@
#include <errno.h>
#include <netdb.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcc.h>
+#include <corosync/corodefs.h>
+#include <corosync/mar_gen.h>
#include <corosync/engine/coroapi.h>
#include <corosync/engine/logsys.h>
@@ -22,7 +26,7 @@
#include "nodelist.h"
#include "ais.h"
-LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME);
/* Local vars - things we get from ccs */
int two_node;
diff --git a/cman/daemon/commands.c b/cman/daemon/commands.c
index ac8d33e..0fe66af 100644
--- a/cman/daemon/commands.c
+++ b/cman/daemon/commands.c
@@ -20,7 +20,11 @@
#include <sys/errno.h>
#include <dlfcn.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcc.h>
+#include <corosync/corodefs.h>
+#include <corosync/mar_gen.h>
#include <corosync/engine/coroapi.h>
#include <corosync/engine/logsys.h>
#include "list.h"
@@ -37,7 +41,7 @@
#include "ais.h"
#define max(a,b) (((a) > (b)) ? (a) : (b))
-LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME);
/* Reference counting for cluster applications */
static int use_count;
@@ -1143,7 +1147,7 @@ static int do_cmd_unregister_quorum_device(char *cmdbuf, int *retlen)
static int reread_config(int new_version)
{
int read_err;
- char *reload_err = NULL;
+ const char *reload_err = NULL;
wanted_config_version = new_version;
@@ -1530,9 +1534,9 @@ int send_to_userport(unsigned char fromport, unsigned char toport,
return ret;
}
-void cman_send_confchg(unsigned int *member_list, int member_list_entries,
- unsigned int *left_list, int left_list_entries,
- unsigned int *joined_list, int joined_list_entries)
+void cman_send_confchg(const unsigned int *member_list, size_t member_list_entries,
+ const unsigned int *left_list, size_t left_list_entries,
+ const unsigned int *joined_list, size_t joined_list_entries)
{
char buf[sizeof(struct sock_confchg_message) +
(member_list_entries+left_list_entries+joined_list_entries) * sizeof(int)];
diff --git a/cman/daemon/commands.h b/cman/daemon/commands.h
index 5d325ad..7b51309 100644
--- a/cman/daemon/commands.h
+++ b/cman/daemon/commands.h
@@ -18,9 +18,9 @@ extern void add_ais_node(int nodeid, uint64_t incarnation, int total_members);
extern void del_ais_node(int nodeid);
extern void add_ccs_node(char *name, int nodeid, int votes, int expected_votes);
extern void override_expected(int expected);
-extern void cman_send_confchg(unsigned int *member_list, int member_list_entries,
- unsigned int *left_list, int left_list_entries,
- unsigned int *joined_list, int joined_list_entries);
+extern void cman_send_confchg(const unsigned int *member_list, size_t member_list_entries,
+ const unsigned int *left_list, size_t left_list_entries,
+ const unsigned int *joined_list, size_t joined_list_entries);
extern void clear_reread_flags(void);
diff --git a/cman/daemon/daemon.c b/cman/daemon/daemon.c
index 1de5964..c67ea21 100644
--- a/cman/daemon/daemon.c
+++ b/cman/daemon/daemon.c
@@ -17,7 +17,11 @@
#include <netinet/in.h>
#include <sys/errno.h>
-#include <corosync/ipc_gen.h>
+#include <corosync/corotypes.h>
+#include <corosync/coroipc_types.h>
+#include <corosync/coroipcc.h>
+#include <corosync/corodefs.h>
+#include <corosync/mar_gen.h>
#include <corosync/engine/coroapi.h>
#include <corosync/engine/logsys.h>
#include <corosync/totem/coropoll.h>
@@ -32,7 +36,7 @@
#include "ais.h"
#include "cman.h"
-LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME);
struct queued_reply
{
diff --git a/cman/daemon/logging.c b/cman/daemon/logging.c
index c18e40f..e81dcec 100644
--- a/cman/daemon/logging.c
+++ b/cman/daemon/logging.c
@@ -15,15 +15,15 @@
#include "cnxman-private.h"
#include "logging.h"
-LOGSYS_DECLARE_SUBSYS (CMAN_NAME, LOG_INFO);
+LOGSYS_DECLARE_SUBSYS (CMAN_NAME);
int subsys_mask = 0;
void set_debuglog(int subsystems)
{
if (subsystems)
- logsys_config_subsys_set(CMAN_NAME, 0, LOG_LEVEL_DEBUG);
+ logsys_config_mode_set(CMAN_NAME, LOGSYS_LEVEL_DEBUG);
else
- logsys_config_subsys_set(CMAN_NAME, 0, LOG_LEVEL_INFO);
+ logsys_config_mode_set(CMAN_NAME, LOGSYS_LEVEL_INFO);
subsys_mask = subsystems;
}
diff --git a/cman/daemon/logging.h b/cman/daemon/logging.h
index 23ecb90..f9ca506 100644
--- a/cman/daemon/logging.h
+++ b/cman/daemon/logging.h
@@ -11,7 +11,7 @@ extern void set_debuglog(int subsystems);
extern int subsys_mask;
-#define P_BARRIER(fmt, args...) if (subsys_mask & CMAN_DEBUG_BARRIER) log_printf(LOG_LEVEL_DEBUG, "barrier: " fmt, ## args)
-#define P_MEMB(fmt, args...) if (subsys_mask & CMAN_DEBUG_MEMB) log_printf(LOG_LEVEL_DEBUG, "memb: " fmt, ## args)
-#define P_DAEMON(fmt, args...) if (subsys_mask & CMAN_DEBUG_DAEMON) log_printf(LOG_LEVEL_DEBUG , "daemon: " fmt, ## args)
-#define P_AIS(fmt, args...) if (subsys_mask & CMAN_DEBUG_AIS) log_printf(LOG_LEVEL_DEBUG, "ais " fmt, ## args)
+#define P_BARRIER(fmt, args...) if (subsys_mask & CMAN_DEBUG_BARRIER) log_printf(LOGSYS_LEVEL_DEBUG, "barrier: " fmt, ## args)
+#define P_MEMB(fmt, args...) if (subsys_mask & CMAN_DEBUG_MEMB) log_printf(LOGSYS_LEVEL_DEBUG, "memb: " fmt, ## args)
+#define P_DAEMON(fmt, args...) if (subsys_mask & CMAN_DEBUG_DAEMON) log_printf(LOGSYS_LEVEL_DEBUG , "daemon: " fmt, ## args)
+#define P_AIS(fmt, args...) if (subsys_mask & CMAN_DEBUG_AIS) log_printf(LOGSYS_LEVEL_DEBUG, "ais " fmt, ## args)
diff --git a/config/libs/libccsconfdb/fullxpath.c b/config/libs/libccsconfdb/fullxpath.c
index 7d9a86e..994c8d8 100644
--- a/config/libs/libccsconfdb/fullxpath.c
+++ b/config/libs/libccsconfdb/fullxpath.c
@@ -51,11 +51,9 @@ static int dump_objdb_buff(confdb_handle_t dump_handle, hdb_handle_t cluster_han
hdb_handle_t object_handle;
char temp[PATH_MAX];
char object_name[PATH_MAX];
- int object_name_len;
char key_name[PATH_MAX];
- int key_name_len;
char key_value[PATH_MAX];
- int key_value_len;
+ size_t key_value_len = 0, key_name_len = 0, object_name_len = 0;
int res;
res = confdb_key_iter_start(dump_handle, parent_object_handle);
diff --git a/config/libs/libccsconfdb/libccs.c b/config/libs/libccsconfdb/libccs.c
index c24bead..05d08c3 100644
--- a/config/libs/libccsconfdb/libccs.c
+++ b/config/libs/libccsconfdb/libccs.c
@@ -60,9 +60,10 @@ static hdb_handle_t find_libccs_handle(confdb_handle_t handle)
static hdb_handle_t find_ccs_handle(confdb_handle_t handle, int ccs_handle)
{
- int res, datalen = 0, found = 0;
+ int res, found = 0;
hdb_handle_t libccs_handle = 0, connection_handle = 0;
char data[128];
+ size_t datalen = 0;
libccs_handle = find_libccs_handle(handle);
if (libccs_handle == -1)
@@ -113,7 +114,7 @@ static int get_running_config_version(confdb_handle_t handle, int *config_versio
{
hdb_handle_t cluster_handle;
char data[128];
- int datalen = 0;
+ size_t datalen = 0;
int ret = -1;
if (confdb_object_find_start(handle, OBJECT_PARENT_HANDLE) != CS_OK) {
@@ -145,7 +146,7 @@ static int get_stored_config_version(confdb_handle_t handle,
hdb_handle_t connection_handle, int *config_version)
{
char data[128];
- int datalen = 0;
+ size_t datalen = 0;
int ret = -1;
if (confdb_key_get
@@ -165,7 +166,7 @@ static int set_stored_config_version(confdb_handle_t handle,
hdb_handle_t connection_handle, int new_version)
{
char temp[PATH_MAX];
- int templen = 0;
+ size_t templen = 0;
char data[128];
memset(data, 0, sizeof(data));
@@ -303,7 +304,7 @@ static hdb_handle_t get_ccs_handle(confdb_handle_t handle, int *ccs_handle,
int get_previous_query(confdb_handle_t handle, hdb_handle_t connection_handle,
char *previous_query, hdb_handle_t *query_handle)
{
- int datalen;
+ size_t datalen = 0;
if (confdb_key_get
(handle, connection_handle, "previous_query",
@@ -323,7 +324,7 @@ int set_previous_query(confdb_handle_t handle, hdb_handle_t connection_handle,
char *previous_query, hdb_handle_t query_handle)
{
char temp[PATH_MAX];
- int templen;
+ size_t templen = 0;
unsigned int temphandle;
if (confdb_key_get
@@ -409,7 +410,8 @@ static int check_cluster_name(int ccs_handle, const char *cluster_name)
confdb_handle_t handle = 0;
hdb_handle_t cluster_handle;
char data[128];
- int found = 0, datalen = 0;
+ int found = 0;
+ size_t datalen = 0;
handle = confdb_connect();
if (handle < 0)
@@ -464,7 +466,7 @@ static int _ccs_get(int desc, const char *query, char **rtn, int list)
confdb_handle_t handle = 0;
hdb_handle_t connection_handle = 0;
char data[128];
- int datalen = 0;
+ size_t datalen = 0;
int fullxpathint = 0;
*rtn = NULL;
@@ -580,7 +582,7 @@ int ccs_disconnect(int desc)
hdb_handle_t connection_handle = 0;
int ret;
char data[128];
- int datalen = 0;
+ size_t datalen = 0;
int fullxpathint = 0;
handle = confdb_connect();
diff --git a/config/libs/libccsconfdb/xpathlite.c b/config/libs/libccsconfdb/xpathlite.c
index 855a323..0c3a46d 100644
--- a/config/libs/libccsconfdb/xpathlite.c
+++ b/config/libs/libccsconfdb/xpathlite.c
@@ -89,7 +89,7 @@ static int path_dive(confdb_handle_t handle, hdb_handle_t *query_handle,
char *start = NULL, *middle = NULL, *end = NULL;
char data[PATH_MAX];
- int datalen;
+ size_t datalen = 0;
/*
* those ones should be always good because
@@ -222,13 +222,13 @@ static int get_data(confdb_handle_t handle, hdb_handle_t connection_handle,
hdb_handle_t query_handle, hdb_handle_t *list_handle,
char **rtn, char *curpos, int list, int is_oldlist)
{
- int datalen, cmp;
+ int cmp;
char data[PATH_MAX];
char resval[PATH_MAX];
char keyval[PATH_MAX];
- int keyvallen = PATH_MAX;
hdb_handle_t new_obj_handle;
unsigned int value = 0;
+ size_t datalen = 0, keyvallen = PATH_MAX;
memset(data, 0, PATH_MAX);
memset(resval, 0, PATH_MAX);
diff --git a/config/tools/ldap/confdb2ldif.c b/config/tools/ldap/confdb2ldif.c
index e57f32e..115bcaf 100644
--- a/config/tools/ldap/confdb2ldif.c
+++ b/config/tools/ldap/confdb2ldif.c
@@ -59,11 +59,11 @@ static void print_config_tree(confdb_handle_t handle, hdb_handle_t parent_object
{
hdb_handle_t object_handle;
char object_name[1024];
- int object_name_len;
+ size_t object_name_len;
char key_name[1024];
- int key_name_len;
+ size_t key_name_len;
char key_value[1024];
- int key_value_len;
+ size_t key_value_len;
char cumulative_dn[4096];
int res;
int i;
diff --git a/fence/fenced/cpg.c b/fence/fenced/cpg.c
index 5d6aa96..54cd46e 100644
--- a/fence/fenced/cpg.c
+++ b/fence/fenced/cpg.c
@@ -1079,9 +1079,12 @@ void process_fd_changes(void)
}
static int add_change(struct fd *fd,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries,
struct change **cg_out)
{
struct change *cg;
@@ -1195,7 +1198,7 @@ static void add_victims_init(struct fd *fd, struct change *cg)
}
}
-static int we_left(struct cpg_address *left_list, int left_list_entries)
+static int we_left(const struct cpg_address *left_list, size_t left_list_entries)
{
int i;
@@ -1206,10 +1209,14 @@ static int we_left(struct cpg_address *left_list, int left_list_entries)
return 0;
}
-static void confchg_cb(cpg_handle_t handle, struct cpg_name *group_name,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries)
+static void confchg_cb(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries)
{
struct fd *fd;
struct change *cg;
@@ -1267,8 +1274,10 @@ static void fd_header_in(struct fd_header *hd)
hd->msgdata = le32_to_cpu(hd->msgdata);
}
-static void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name,
- uint32_t nodeid, uint32_t pid, void *data, int len)
+static void deliver_cb(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ uint32_t nodeid, uint32_t pid,
+ void *data, size_t len)
{
struct fd *fd;
struct fd_header *hd;
@@ -1742,8 +1751,10 @@ int set_protocol(void)
kernel state and they can skip fencing us if we're a victim. (We have
to check for that uncontrolled state before calling setup_cpg, obviously.) */
-static void deliver_cb_daemon(cpg_handle_t handle, struct cpg_name *group_name,
- uint32_t nodeid, uint32_t pid, void *data, int len)
+static void deliver_cb_daemon(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ uint32_t nodeid, uint32_t pid,
+ void *data, size_t len)
{
struct fd_header *hd;
@@ -1764,10 +1775,14 @@ static void deliver_cb_daemon(cpg_handle_t handle, struct cpg_name *group_name,
}
}
-static void confchg_cb_daemon(cpg_handle_t handle, struct cpg_name *group_name,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries)
+static void confchg_cb_daemon(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries)
{
int i;
diff --git a/group/daemon/cpg.c b/group/daemon/cpg.c
index 43c8ddd..dde9bb9 100644
--- a/group/daemon/cpg.c
+++ b/group/daemon/cpg.c
@@ -609,8 +609,10 @@ group_t *find_group_by_handle(cpg_handle_t h)
return NULL;
}
-void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name,
- uint32_t nodeid, uint32_t pid, void *data, int data_len)
+void deliver_cb(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ uint32_t nodeid, uint32_t pid,
+ void *data, size_t data_len)
{
group_t *g;
struct save_msg *save;
@@ -742,10 +744,14 @@ void process_confchg(void)
}
}
-void confchg_cb(cpg_handle_t handle, struct cpg_name *group_name,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries)
+void confchg_cb(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries)
{
group_t *g;
char *name = "unknown";
diff --git a/group/dlm_controld/cpg.c b/group/dlm_controld/cpg.c
index 1231ec9..43b36fd 100644
--- a/group/dlm_controld/cpg.c
+++ b/group/dlm_controld/cpg.c
@@ -1175,9 +1175,12 @@ void process_lockspace_changes(void)
}
static int add_change(struct lockspace *ls,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries,
struct change **cg_out)
{
struct change *cg;
@@ -1274,7 +1277,7 @@ static int add_change(struct lockspace *ls,
return error;
}
-static int we_left(struct cpg_address *left_list, int left_list_entries)
+static int we_left(const struct cpg_address *left_list, size_t left_list_entries)
{
int i;
@@ -1285,10 +1288,14 @@ static int we_left(struct cpg_address *left_list, int left_list_entries)
return 0;
}
-static void confchg_cb(cpg_handle_t handle, struct cpg_name *group_name,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries)
+static void confchg_cb(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries)
{
struct lockspace *ls;
struct change *cg;
@@ -1349,8 +1356,10 @@ static void dlm_header_in(struct dlm_header *hd)
hd->msgdata = le32_to_cpu(hd->msgdata);
}
-static void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name,
- uint32_t nodeid, uint32_t pid, void *data, int len)
+static void deliver_cb(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ uint32_t nodeid, uint32_t pid,
+ void *data, size_t len)
{
struct lockspace *ls;
struct dlm_header *hd;
@@ -1945,8 +1954,10 @@ int set_protocol(void)
return 0;
}
-static void deliver_cb_daemon(cpg_handle_t handle, struct cpg_name *group_name,
- uint32_t nodeid, uint32_t pid, void *data, int len)
+static void deliver_cb_daemon(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ uint32_t nodeid, uint32_t pid,
+ void *data, size_t len)
{
struct dlm_header *hd;
@@ -1967,10 +1978,14 @@ static void deliver_cb_daemon(cpg_handle_t handle, struct cpg_name *group_name,
}
}
-static void confchg_cb_daemon(cpg_handle_t handle, struct cpg_name *group_name,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries)
+static void confchg_cb_daemon(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries)
{
int i;
diff --git a/group/dlm_controld/deadlock.c b/group/dlm_controld/deadlock.c
index 4d93420..05b2241 100644
--- a/group/dlm_controld/deadlock.c
+++ b/group/dlm_controld/deadlock.c
@@ -1076,9 +1076,9 @@ static void node_left(struct lockspace *ls, int nodeid, int reason)
static void purge_locks(struct lockspace *ls, int nodeid);
void deadlk_confchg(struct lockspace *ls,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries)
+ const struct cpg_address *member_list, int member_list_entries,
+ const struct cpg_address *left_list, int left_list_entries,
+ const struct cpg_address *joined_list, int joined_list_entries)
{
int i;
diff --git a/group/dlm_controld/dlm_daemon.h b/group/dlm_controld/dlm_daemon.h
index 60c48cd..8933db7 100644
--- a/group/dlm_controld/dlm_daemon.h
+++ b/group/dlm_controld/dlm_daemon.h
@@ -257,9 +257,9 @@ void receive_cycle_start(struct lockspace *ls, struct dlm_header *hd, int len);
void receive_cycle_end(struct lockspace *ls, struct dlm_header *hd, int len);
void receive_cancel_lock(struct lockspace *ls, struct dlm_header *hd, int len);
void deadlk_confchg(struct lockspace *ls,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries);
+ const struct cpg_address *member_list, int member_list_entries,
+ const struct cpg_address *left_list, int left_list_entries,
+ const struct cpg_address *joined_list, int joined_list_entries);
/* main.c */
diff --git a/group/gfs_controld/cpg-new.c b/group/gfs_controld/cpg-new.c
index f15e3e5..5fafd61 100644
--- a/group/gfs_controld/cpg-new.c
+++ b/group/gfs_controld/cpg-new.c
@@ -2329,9 +2329,12 @@ void process_mountgroups(void)
}
static int add_change(struct mountgroup *mg,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries,
struct change **cg_out)
{
struct change *cg;
@@ -2429,7 +2432,7 @@ static int add_change(struct mountgroup *mg,
return error;
}
-static int we_left(struct cpg_address *left_list, int left_list_entries)
+static int we_left(const struct cpg_address *left_list, size_t left_list_entries)
{
int i;
@@ -2440,10 +2443,14 @@ static int we_left(struct cpg_address *left_list, int left_list_entries)
return 0;
}
-static void confchg_cb(cpg_handle_t handle, struct cpg_name *group_name,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries)
+static void confchg_cb(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries)
{
struct mountgroup *mg;
struct change *cg;
@@ -2522,8 +2529,10 @@ static int gfs_header_check(struct gfs_header *hd, int nodeid)
return 0;
}
-static void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name,
- uint32_t nodeid, uint32_t pid, void *data, int len)
+static void deliver_cb(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ uint32_t nodeid, uint32_t pid,
+ void *data, size_t len)
{
struct mountgroup *mg;
struct gfs_header *hd;
@@ -3133,8 +3142,10 @@ int set_protocol(void)
return 0;
}
-static void deliver_cb_daemon(cpg_handle_t handle, struct cpg_name *group_name,
- uint32_t nodeid, uint32_t pid, void *data, int len)
+static void deliver_cb_daemon(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ uint32_t nodeid, uint32_t pid,
+ void *data, size_t len)
{
struct gfs_header *hd;
@@ -3160,10 +3171,14 @@ static void deliver_cb_daemon(cpg_handle_t handle, struct cpg_name *group_name,
}
}
-static void confchg_cb_daemon(cpg_handle_t handle, struct cpg_name *group_name,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries)
+static void confchg_cb_daemon(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries)
{
int i;
diff --git a/group/gfs_controld/cpg-old.c b/group/gfs_controld/cpg-old.c
index 6daaa9a..666b399 100644
--- a/group/gfs_controld/cpg-old.c
+++ b/group/gfs_controld/cpg-old.c
@@ -168,7 +168,7 @@ static void notify_mount_client(struct mountgroup *mg)
/* we can receive recovery_status messages from other nodes doing start before
we actually process the corresponding start callback ourselves */
-void save_message_old(struct mountgroup *mg, char *buf, int len, int from,
+void save_message_old(struct mountgroup *mg, char *buf, size_t len, int from,
int type)
{
struct save_msg *sm;
@@ -250,7 +250,7 @@ void send_withdraw_old(struct mountgroup *mg)
free(buf);
}
-static void receive_withdraw(struct mountgroup *mg, char *buf, int len, int from)
+static void receive_withdraw(struct mountgroup *mg, char *buf, size_t len, int from)
{
struct mg_member *memb;
@@ -316,7 +316,7 @@ static void send_recovery_status(struct mountgroup *mg)
the journal for a failed node. The first has really recovered it,
the rest have found the fs clean and report success. */
-static void _receive_recovery_status(struct mountgroup *mg, char *buf, int len,
+static void _receive_recovery_status(struct mountgroup *mg, char *buf, size_t len,
int from)
{
struct mg_member *memb;
@@ -437,7 +437,7 @@ void send_mount_status_old(struct mountgroup *mg)
free(buf);
}
-static void _receive_mount_status(struct mountgroup *mg, char *buf, int len,
+static void _receive_mount_status(struct mountgroup *mg, char *buf, size_t len,
int from)
{
struct mg_member *memb, *us;
@@ -503,7 +503,7 @@ static void _receive_mount_status(struct mountgroup *mg, char *buf, int len,
}
}
-static void receive_mount_status(struct mountgroup *mg, char *buf, int len,
+static void receive_mount_status(struct mountgroup *mg, char *buf, size_t len,
int from)
{
log_group(mg, "receive_mount_status from %d len %d last_cb %d",
@@ -546,7 +546,7 @@ static void process_saved_mount_status(struct mountgroup *mg)
}
}
-static void receive_recovery_status(struct mountgroup *mg, char *buf, int len,
+static void receive_recovery_status(struct mountgroup *mg, char *buf, size_t len,
int from)
{
switch (mg->last_callback) {
@@ -588,7 +588,7 @@ static void send_recovery_done(struct mountgroup *mg)
free(buf);
}
-static void receive_recovery_done(struct mountgroup *mg, char *buf, int len,
+static void receive_recovery_done(struct mountgroup *mg, char *buf, size_t len,
int from)
{
struct mg_member *memb, *safe;
@@ -637,7 +637,7 @@ void send_remount_old(struct mountgroup *mg, struct gfsc_mount_args *ma)
free(buf);
}
-static void receive_remount(struct mountgroup *mg, char *buf, int len, int from)
+static void receive_remount(struct mountgroup *mg, char *buf, size_t len, int from)
{
struct mg_member *memb;
char *options;
@@ -879,7 +879,7 @@ static int assign_journal(struct mountgroup *mg, struct mg_member *new)
return 0;
}
-static void _receive_options(struct mountgroup *mg, char *buf, int len,
+static void _receive_options(struct mountgroup *mg, char *buf, size_t len,
int from)
{
struct mg_member *memb;
@@ -912,7 +912,7 @@ static void _receive_options(struct mountgroup *mg, char *buf, int len,
assign_journal(mg, memb);
}
-static void receive_options(struct mountgroup *mg, char *buf, int len, int from)
+static void receive_options(struct mountgroup *mg, char *buf, size_t len, int from)
{
struct gdlm_header *hd = (struct gdlm_header *)buf;
struct mg_member *memb;
@@ -1046,7 +1046,7 @@ static void received_our_jid(struct mountgroup *mg)
notify_mount_client(mg);
}
-static void _receive_journals(struct mountgroup *mg, char *buf, int len,
+static void _receive_journals(struct mountgroup *mg, char *buf, size_t len,
int from)
{
struct mg_member *memb, *memb2;
@@ -1114,7 +1114,7 @@ static void _receive_journals(struct mountgroup *mg, char *buf, int len,
received_our_jid(mg);
}
-static void receive_journals(struct mountgroup *mg, char *buf, int len,
+static void receive_journals(struct mountgroup *mg, char *buf, size_t len,
int from)
{
struct gdlm_header *hd = (struct gdlm_header *)buf;
@@ -2229,7 +2229,7 @@ int do_terminate(struct mountgroup *mg)
return 0;
}
-static void do_deliver(int nodeid, char *data, int len)
+static void do_deliver(int nodeid, char *data, size_t len)
{
struct mountgroup *mg;
struct gdlm_header *hd;
@@ -2325,8 +2325,10 @@ static void do_deliver(int nodeid, char *data, int len)
}
}
-static void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name,
- uint32_t nodeid, uint32_t pid, void *data, int data_len)
+static void deliver_cb(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ uint32_t nodeid, uint32_t pid,
+ void *data, size_t data_len)
{
do_deliver(nodeid, data, data_len);
}
@@ -2336,10 +2338,14 @@ static void deliver_cb(cpg_handle_t handle, struct cpg_name *group_name,
Is it possible for a node to have been cleared from the members_gone list
before this confchg is processed? */
-static void confchg_cb(cpg_handle_t handle, struct cpg_name *group_name,
- struct cpg_address *member_list, int member_list_entries,
- struct cpg_address *left_list, int left_list_entries,
- struct cpg_address *joined_list, int joined_list_entries)
+static void confchg_cb(cpg_handle_t handle,
+ const struct cpg_name *group_name,
+ const struct cpg_address *member_list,
+ size_t member_list_entries,
+ const struct cpg_address *left_list,
+ size_t left_list_entries,
+ const struct cpg_address *joined_list,
+ size_t joined_list_entries)
{
struct mountgroup *mg;
int i, nodeid;
diff --git a/group/gfs_controld/gfs_daemon.h b/group/gfs_controld/gfs_daemon.h
index c4dc2be..cf56d19 100644
--- a/group/gfs_controld/gfs_daemon.h
+++ b/group/gfs_controld/gfs_daemon.h
@@ -248,7 +248,7 @@ void process_cpg_old(int ci);
int gfs_join_mountgroup_old(struct mountgroup *mg, struct gfsc_mount_args *ma);
void do_leave_old(char *name, int mnterr);
int send_group_message_old(struct mountgroup *mg, int len, char *buf);
-void save_message_old(struct mountgroup *mg, char *buf, int len, int from,
+void save_message_old(struct mountgroup *mg, char *buf, size_t len, int from,
int type);
void send_withdraw_old(struct mountgroup *mg);
int process_recovery_uevent_old(char *name, int jid, int status, int first);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-04-27 8:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-27 8:49 cluster: STABLE3 - misc: port the whole stack to the new corosync API Fabio M. Di Nitto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).