Index: LVM2.2.02.39/daemons/clvmd/clvmd-comms.h =================================================================== --- LVM2.2.02.39.orig/daemons/clvmd/clvmd-comms.h 2007-05-21 18:52:01.000000000 +0800 +++ LVM2.2.02.39/daemons/clvmd/clvmd-comms.h 2009-12-02 13:47:51.000000000 +0800 @@ -76,13 +76,13 @@ #endif #ifdef USE_OPENAIS -# include -# include +# include +# include # define OPENAIS_CSID_LEN (sizeof(int)) # define OPENAIS_MAX_CLUSTER_MESSAGE MESSAGE_SIZE_MAX -# define OPENAIS_MAX_CLUSTER_MEMBER_NAME_LEN SA_MAX_NAME_LENGTH +# define OPENAIS_MAX_CLUSTER_MEMBER_NAME_LEN CS_MAX_NAME_LENGTH # ifndef MAX_CLUSTER_MEMBER_NAME_LEN -# define MAX_CLUSTER_MEMBER_NAME_LEN SA_MAX_NAME_LENGTH +# define MAX_CLUSTER_MEMBER_NAME_LEN CS_MAX_NAME_LENGTH # endif # ifndef CMAN_MAX_CLUSTER_MESSAGE # define CMAN_MAX_CLUSTER_MESSAGE MESSAGE_SIZE_MAX Index: LVM2.2.02.39/daemons/clvmd/clvmd-openais.c =================================================================== --- LVM2.2.02.39.orig/daemons/clvmd/clvmd-openais.c 2009-12-02 13:46:31.000000000 +0800 +++ LVM2.2.02.39/daemons/clvmd/clvmd-openais.c 2009-12-02 13:58:41.000000000 +0800 @@ -36,8 +36,8 @@ #include #include -#include -#include +#include +#include #include "list.h" #include "locking.h" @@ -99,88 +99,88 @@ }; /* Set errno to something approximating the right value and return 0 or -1 */ -static int ais_to_errno(SaAisErrorT err) +static int ais_to_errno(cs_error_t err) { switch(err) { - case SA_AIS_OK: + case CS_OK: return 0; - case SA_AIS_ERR_LIBRARY: + case CS_ERR_LIBRARY: errno = EINVAL; break; - case SA_AIS_ERR_VERSION: + case CS_ERR_VERSION: errno = EINVAL; break; - case SA_AIS_ERR_INIT: + case CS_ERR_INIT: errno = EINVAL; break; - case SA_AIS_ERR_TIMEOUT: + case CS_ERR_TIMEOUT: errno = ETIME; break; - case SA_AIS_ERR_TRY_AGAIN: + case CS_ERR_TRY_AGAIN: errno = EAGAIN; break; - case SA_AIS_ERR_INVALID_PARAM: + case CS_ERR_INVALID_PARAM: errno = EINVAL; break; - case SA_AIS_ERR_NO_MEMORY: + case CS_ERR_NO_MEMORY: errno = ENOMEM; break; - case SA_AIS_ERR_BAD_HANDLE: + case CS_ERR_BAD_HANDLE: errno = EINVAL; break; - case SA_AIS_ERR_BUSY: + case CS_ERR_BUSY: errno = EBUSY; break; - case SA_AIS_ERR_ACCESS: + case CS_ERR_ACCESS: errno = EPERM; break; - case SA_AIS_ERR_NOT_EXIST: + case CS_ERR_NOT_EXIST: errno = ENOENT; break; - case SA_AIS_ERR_NAME_TOO_LONG: + case CS_ERR_NAME_TOO_LONG: errno = ENAMETOOLONG; break; - case SA_AIS_ERR_EXIST: + case CS_ERR_EXIST: errno = EEXIST; break; - case SA_AIS_ERR_NO_SPACE: + case CS_ERR_NO_SPACE: errno = ENOSPC; break; - case SA_AIS_ERR_INTERRUPT: + case CS_ERR_INTERRUPT: errno = EINTR; break; - case SA_AIS_ERR_NAME_NOT_FOUND: + case CS_ERR_NAME_NOT_FOUND: errno = ENOENT; break; - case SA_AIS_ERR_NO_RESOURCES: + case CS_ERR_NO_RESOURCES: errno = ENOMEM; break; - case SA_AIS_ERR_NOT_SUPPORTED: + case CS_ERR_NOT_SUPPORTED: errno = EOPNOTSUPP; break; - case SA_AIS_ERR_BAD_OPERATION: + case CS_ERR_BAD_OPERATION: errno = EINVAL; break; - case SA_AIS_ERR_FAILED_OPERATION: + case CS_ERR_FAILED_OPERATION: errno = EIO; break; - case SA_AIS_ERR_MESSAGE_ERROR: + case CS_ERR_MESSAGE_ERROR: errno = EIO; break; - case SA_AIS_ERR_QUEUE_FULL: + case CS_ERR_QUEUE_FULL: errno = EXFULL; break; - case SA_AIS_ERR_QUEUE_NOT_AVAILABLE: + case CS_ERR_QUEUE_NOT_AVAILABLE: errno = EINVAL; break; - case SA_AIS_ERR_BAD_FLAGS: + case CS_ERR_BAD_FLAGS: errno = EINVAL; break; - case SA_AIS_ERR_TOO_BIG: + case CS_ERR_TOO_BIG: errno = E2BIG; break; - case SA_AIS_ERR_NO_SECTIONS: + case CS_ERR_NO_SECTIONS: errno = ENOMEM; break; default: @@ -309,13 +309,13 @@ static int _init_cluster(void) { - SaAisErrorT err; + cs_error_t err; node_hash = dm_hash_create(100); err = cpg_initialize(&cpg_handle, &cpg_callbacks); - if (err != SA_AIS_OK) { + if (err != CS_OK) { syslog(LOG_ERR, "Cannot initialise OpenAIS CPG service: %d", err); DEBUGLOG("Cannot initialise OpenAIS CPG service: %d", err); @@ -340,7 +340,7 @@ strcpy((char *)cpg_group_name.value, "clvmd"); cpg_group_name.length = strlen((char *)cpg_group_name.value); err = cpg_join(cpg_handle, &cpg_group_name); - if (err != SA_AIS_OK) { + if (err != CS_OK) { cpg_finalize(cpg_handle); dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1); syslog(LOG_ERR, "Cannot join clvmd process group"); @@ -350,7 +350,7 @@ err = cpg_local_get(cpg_handle, &our_nodeid); - if (err != SA_AIS_OK) { + if (err != CS_OK) { cpg_leave(cpg_handle, &cpg_group_name); cpg_finalize(cpg_handle); dlm_release_lockspace(LOCKSPACE_NAME, lockspace, 1); @@ -550,7 +550,7 @@ { cluster_client = fd; *new_client = NULL; - cpg_dispatch(cpg_handle, SA_DISPATCH_ONE); + cpg_dispatch(cpg_handle, CPG_DISPATCH_ONE); return 1; } @@ -558,7 +558,7 @@ const char *errtext) { struct iovec iov[2]; - SaAisErrorT err; + cs_error_t err; int target_node; if (csid)