[Openais] [PATCH] [OPENAIS-trunk] fix warnings introduced by corosync changes

Steven Dake sdake at redhat.com
Tue Nov 25 08:06:35 PST 2008


good for merging 

Thanks!
-steve

On Mon, 2008-11-17 at 08:53 +1300, angus salkeld wrote:
> Hi
> 
> This just fixes some warning I introduced with the corosync changes.
> 
> -Angus
> 
> ---
>  include/mar_clm.h |    5 +++--
>  lib/amf.c         |    2 +-
>  lib/ckpt.c        |   35 ++++++++++++++++++-----------------
>  lib/evt.c         |   16 +++++++++-------
>  lib/lck.c         |   19 ++++++++++---------
>  5 files changed, 41 insertions(+), 36 deletions(-)
> 
> diff --git a/include/mar_clm.h b/include/mar_clm.h
> index dbcdf7d..4188063 100644
> --- a/include/mar_clm.h
> +++ b/include/mar_clm.h
> @@ -39,6 +39,7 @@
>  #include <corosync/swab.h>
>  #include "saAis.h"
>  #include "saClm.h"
> +#include "mar_sa.h"
>  #include <corosync/mar_gen.h>
>  
>  #define MAR_CLM_MAX_ADDRESS_LENGTH 64
> @@ -110,7 +111,7 @@ static inline void marshall_to_mar_clm_cluster_node_t (
>  	dest->node_id = src->nodeId;
>  	marshall_to_mar_clm_node_address_t (&dest->node_address,
>  		&src->nodeAddress);
> -	marshall_to_mar_name_t (&dest->node_name, &src->nodeName);
> +	marshall_SaNameT_to_mar_name_t (&dest->node_name, &src->nodeName);
>  	dest->member = src->member;
>  	dest->boot_timestamp = src->bootTimestamp;
>  	dest->initial_view_number = src->initialViewNumber;
> @@ -123,7 +124,7 @@ static inline void marshall_from_mar_clm_cluster_node_t (
>  	dest->nodeId = src->node_id;
>  	marshall_from_mar_clm_node_address_t (&dest->nodeAddress,
>  		&src->node_address);
> -	marshall_from_mar_name_t (&dest->nodeName, &src->node_name);
> +	marshall_mar_name_t_to_SaNameT (&dest->nodeName, &src->node_name);
>  	dest->member = src->member;
>  	dest->bootTimestamp = src->boot_timestamp;
>  	dest->initialViewNumber = src->initial_view_number;
> diff --git a/lib/amf.c b/lib/amf.c
> index 65741a2..6471e80 100644
> --- a/lib/amf.c
> +++ b/lib/amf.c
> @@ -49,7 +49,7 @@
>  #include <saAmf.h>
>  #include <corosync/ipc_gen.h>
>  #include <ipc_amf.h>
> -#include <corosync/ais_util.h>
> +#include "util.h"
>  
> 
>  struct res_overlay {
> diff --git a/lib/ckpt.c b/lib/ckpt.c
> index 7bdf12c..d30ac7b 100644
> --- a/lib/ckpt.c
> +++ b/lib/ckpt.c
> @@ -53,8 +53,9 @@
>  #include "../include/saCkpt.h"
>  #include "../include/ipc_ckpt.h"
>  #include "../include/mar_ckpt.h"
> +#include "../include/mar_sa.h"
>  
> -#include <corosync/ais_util.h>
> +#include "util.h"
>  
>  struct message_overlay {
>  	mar_res_header_t header __attribute__((aligned(8)));
> @@ -634,7 +635,7 @@ saCkptCheckpointOpen (
>  
>  	req_lib_ckpt_checkpointopen.header.size = sizeof (struct req_lib_ckpt_checkpointopen);
>  	req_lib_ckpt_checkpointopen.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTOPEN;
> -	marshall_to_mar_name_t (&req_lib_ckpt_checkpointopen.checkpoint_name,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointopen.checkpoint_name,
>  		(SaNameT *)checkpointName);
>  	memcpy (&ckptCheckpointInstance->checkpointName, checkpointName, sizeof (SaNameT));
>  	req_lib_ckpt_checkpointopen.async_call = 0;
> @@ -759,7 +760,7 @@ saCkptCheckpointOpenAsync (
>  	if (failWithError == SA_AIS_OK) {
>  		memcpy (&ckptCheckpointInstance->checkpointName, checkpointName,
>  			sizeof (SaNameT));
> -		marshall_to_mar_name_t (&req_lib_ckpt_checkpointopen.checkpoint_name,
> +		marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointopen.checkpoint_name,
>  			(SaNameT *)checkpointName);
>  	}
>  
> @@ -829,7 +830,7 @@ saCkptCheckpointClose (
>  
>  	req_lib_ckpt_checkpointclose.header.size = sizeof (struct req_lib_ckpt_checkpointclose);
>  	req_lib_ckpt_checkpointclose.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTCLOSE;
> -	marshall_to_mar_name_t (&req_lib_ckpt_checkpointclose.checkpoint_name,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointclose.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_checkpointclose.ckpt_id =
>  		ckptCheckpointInstance->checkpointId;
> @@ -877,7 +878,7 @@ saCkptCheckpointUnlink (
>  
>  	req_lib_ckpt_checkpointunlink.header.size = sizeof (struct req_lib_ckpt_checkpointunlink);
>  	req_lib_ckpt_checkpointunlink.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTUNLINK;
> -	marshall_to_mar_name_t (&req_lib_ckpt_checkpointunlink.checkpoint_name,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointunlink.checkpoint_name,
>  		(SaNameT *)checkpointName);
>  
>  	pthread_mutex_lock (&ckptInstance->response_mutex);
> @@ -916,7 +917,7 @@ saCkptCheckpointRetentionDurationSet (
>  	req_lib_ckpt_checkpointretentiondurationset.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTRETENTIONDURATIONSET;
>  
>  	req_lib_ckpt_checkpointretentiondurationset.retention_duration = retentionDuration;
> -	marshall_to_mar_name_t (&req_lib_ckpt_checkpointretentiondurationset.checkpoint_name,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointretentiondurationset.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_checkpointretentiondurationset.ckpt_id =
>  		ckptCheckpointInstance->checkpointId;
> @@ -957,7 +958,7 @@ saCkptActiveReplicaSet (
>  
>  	req_lib_ckpt_activereplicaset.header.size = sizeof (struct req_lib_ckpt_activereplicaset);
>  	req_lib_ckpt_activereplicaset.header.id = MESSAGE_REQ_CKPT_ACTIVEREPLICASET;
> -	marshall_to_mar_name_t (&req_lib_ckpt_activereplicaset.checkpoint_name,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_activereplicaset.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_activereplicaset.ckpt_id =
>  		ckptCheckpointInstance->checkpointId;
> @@ -1000,7 +1001,7 @@ saCkptCheckpointStatusGet (
>  	req_lib_ckpt_checkpointstatusget.header.size = sizeof (struct req_lib_ckpt_checkpointstatusget);
>  	req_lib_ckpt_checkpointstatusget.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSTATUSGET;
>  
> -	marshall_to_mar_name_t (&req_lib_ckpt_checkpointstatusget.checkpoint_name,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointstatusget.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_checkpointstatusget.ckpt_id =
>  		ckptCheckpointInstance->checkpointId;
> @@ -1065,7 +1066,7 @@ saCkptSectionCreate (
>  	req_lib_ckpt_sectioncreate.expiration_time = sectionCreationAttributes->expirationTime;
>  	req_lib_ckpt_sectioncreate.initial_data_size = initialDataSize;
>  
> -	marshall_to_mar_name_t (&req_lib_ckpt_sectioncreate.checkpoint_name,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_sectioncreate.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_sectioncreate.ckpt_id =
>  		ckptCheckpointInstance->checkpointId;
> @@ -1137,7 +1138,7 @@ saCkptSectionDelete (
>  	req_lib_ckpt_sectiondelete.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONDELETE;
>  	req_lib_ckpt_sectiondelete.id_len = sectionId->idLen;
>  
> -	marshall_to_mar_name_t (
> +	marshall_SaNameT_to_mar_name_t (
>  		&req_lib_ckpt_sectiondelete.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_sectiondelete.ckpt_id =
> @@ -1201,7 +1202,7 @@ saCkptSectionExpirationTimeSet (
>  	req_lib_ckpt_sectionexpirationtimeset.id_len = sectionId->idLen;
>  	req_lib_ckpt_sectionexpirationtimeset.expiration_time = expirationTime;
>  
> -	marshall_to_mar_name_t (&req_lib_ckpt_sectionexpirationtimeset.checkpoint_name,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_sectionexpirationtimeset.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_sectionexpirationtimeset.ckpt_id =
>  		ckptCheckpointInstance->checkpointId;
> @@ -1303,7 +1304,7 @@ saCkptSectionIterationInitialize (
>  	req_lib_ckpt_sectioniterationinitialize.header.id = MESSAGE_REQ_CKPT_SECTIONITERATIONINITIALIZE;
>  	req_lib_ckpt_sectioniterationinitialize.sections_chosen = sectionsChosen;
>  	req_lib_ckpt_sectioniterationinitialize.expiration_time = expirationTime;
> -	marshall_to_mar_name_t (
> +	marshall_SaNameT_to_mar_name_t (
>  		&req_lib_ckpt_sectioniterationinitialize.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_sectioniterationinitialize.ckpt_id =
> @@ -1529,7 +1530,7 @@ saCkptCheckpointWrite (
>  		req_lib_ckpt_sectionwrite.data_size = ioVector[i].dataSize;
>  		req_lib_ckpt_sectionwrite.id_len = ioVector[i].sectionId.idLen;
>  
> -		marshall_to_mar_name_t (&req_lib_ckpt_sectionwrite.checkpoint_name,
> +		marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_sectionwrite.checkpoint_name,
>  			&ckptCheckpointInstance->checkpointName);
>  		req_lib_ckpt_sectionwrite.ckpt_id =
>  			ckptCheckpointInstance->checkpointId;
> @@ -1623,7 +1624,7 @@ saCkptSectionOverwrite (
>  	req_lib_ckpt_sectionoverwrite.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_SECTIONOVERWRITE;
>  	req_lib_ckpt_sectionoverwrite.id_len = sectionId->idLen;
>  	req_lib_ckpt_sectionoverwrite.data_size = dataSize;
> -	marshall_to_mar_name_t (&req_lib_ckpt_sectionoverwrite.checkpoint_name,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_sectionoverwrite.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_sectionoverwrite.ckpt_id =
>  		ckptCheckpointInstance->checkpointId;
> @@ -1701,7 +1702,7 @@ saCkptCheckpointRead (
>  		req_lib_ckpt_sectionread.data_offset = ioVector[i].dataOffset;
>  		req_lib_ckpt_sectionread.data_size = ioVector[i].dataSize;
>  
> -		marshall_to_mar_name_t (&req_lib_ckpt_sectionread.checkpoint_name,
> +		marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_sectionread.checkpoint_name,
>  			&ckptCheckpointInstance->checkpointName);
>  		req_lib_ckpt_sectionread.ckpt_id =
>  			ckptCheckpointInstance->checkpointId;
> @@ -1793,7 +1794,7 @@ saCkptCheckpointSynchronize (
>  
>  	req_lib_ckpt_checkpointsynchronize.header.size = sizeof (struct req_lib_ckpt_checkpointsynchronize); 
>  	req_lib_ckpt_checkpointsynchronize.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZE;
> -	marshall_to_mar_name_t (&req_lib_ckpt_checkpointsynchronize.checkpoint_name,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_ckpt_checkpointsynchronize.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_checkpointsynchronize.ckpt_id =
>  		ckptCheckpointInstance->checkpointId;
> @@ -1852,7 +1853,7 @@ saCkptCheckpointSynchronizeAsync (
>  
>  	req_lib_ckpt_checkpointsynchronizeasync.header.size = sizeof (struct req_lib_ckpt_checkpointsynchronizeasync); 
>  	req_lib_ckpt_checkpointsynchronizeasync.header.id = MESSAGE_REQ_CKPT_CHECKPOINT_CHECKPOINTSYNCHRONIZEASYNC;
> -	marshall_to_mar_name_t (
> +	marshall_SaNameT_to_mar_name_t (
>  		&req_lib_ckpt_checkpointsynchronizeasync.checkpoint_name,
>  		&ckptCheckpointInstance->checkpointName);
>  	req_lib_ckpt_checkpointsynchronizeasync.ckpt_id =
> diff --git a/lib/evt.c b/lib/evt.c
> index 73c52c1..d65acb3 100644
> --- a/lib/evt.c
> +++ b/lib/evt.c
> @@ -39,9 +39,11 @@
>  #include <unistd.h>
>  #include <sys/time.h>
>  #include <sys/socket.h>
> -#include <corosync/ais_util.h>
>  #include <corosync/list.h>
> -#include "../include/ipc_evt.h"
> +#include "ipc_evt.h"
> +#include "mar_sa.h"
> +#include "saAis.h"
> +#include "util.h"
>  
>  #define MESSAGE_SIZE_MAX 1024*1024
>  
> @@ -507,7 +509,7 @@ static SaAisErrorT make_event(SaEvtEventHandleT *event_handle,
>  	edi->edi_pub_time = evt->led_publish_time;
>  	edi->edi_event_data_size = evt->led_user_data_size;
>  	edi->edi_event_id = evt->led_event_id;
> -	marshall_from_mar_name_t (&edi->edi_pub_name, &evt->led_publisher_name);
> +	marshall_mar_name_t_to_SaNameT (&edi->edi_pub_name, &evt->led_publisher_name);
>  
>  	if (edi->edi_event_data_size) {
>  		edi->edi_event_data = malloc(edi->edi_event_data_size);
> @@ -997,7 +999,7 @@ saEvtChannelOpen(
>  	req.ico_c_handle = *channelHandle;
>  	req.ico_timeout = timeout;
>  	req.ico_open_flag = channelOpenFlags;
> -	marshall_to_mar_name_t (&req.ico_channel_name, (SaNameT *)channelName);
> +	marshall_SaNameT_to_mar_name_t (&req.ico_channel_name, (SaNameT *)channelName);
>  
>  	iov.iov_base = (char *)&req;
>  	iov.iov_len = sizeof(req);
> @@ -1223,7 +1225,7 @@ saEvtChannelOpenAsync(SaEvtHandleT evtHandle,
>  	req.ico_timeout = 0;
>  	req.ico_invocation = invocation;
>  	req.ico_open_flag = channelOpenFlags;
> -	marshall_to_mar_name_t (&req.ico_channel_name, (SaNameT *)channelName);
> +	marshall_SaNameT_to_mar_name_t (&req.ico_channel_name, (SaNameT *)channelName);
>  	iov.iov_base = (char *)&req;
>  	iov.iov_len = sizeof(req);
>  
> @@ -1324,7 +1326,7 @@ saEvtChannelUnlink(
>  	 */
>  	req.iuc_head.size = sizeof(req);
>  	req.iuc_head.id = MESSAGE_REQ_EVT_UNLINK_CHANNEL;
> -	marshall_to_mar_name_t (&req.iuc_channel_name, (SaNameT *)channelName);
> +	marshall_SaNameT_to_mar_name_t (&req.iuc_channel_name, (SaNameT *)channelName);
>  	iov.iov_base = (char *)&req;
>  	iov.iov_len = sizeof(req);
>  
> @@ -1999,7 +2001,7 @@ saEvtEventPublish(
>  	req->led_retention_time = edi->edi_retention_time;
>  	req->led_publish_time = clustTimeNow();
>  	req->led_priority = edi->edi_priority;
> -	marshall_to_mar_name_t (&req->led_publisher_name, &edi->edi_pub_name);
> +	marshall_SaNameT_to_mar_name_t (&req->led_publisher_name, &edi->edi_pub_name);
>  
>  	iov.iov_base = (char *)req;
>  	iov.iov_len = req->led_head.size;
> diff --git a/lib/lck.c b/lib/lck.c
> index d28e511..e63db52 100644
> --- a/lib/lck.c
> +++ b/lib/lck.c
> @@ -49,7 +49,8 @@
>  #include <corosync/list.h>
>  #include <saLck.h>
>  #include <corosync/ipc_gen.h>
> -#include "../include/ipc_lck.h"
> +#include "ipc_lck.h"
> +#include "mar_sa.h"
>  
>  #include "util.h"
>  
> @@ -671,7 +672,7 @@ saLckResourceOpen (
>  	req_lib_lck_resourceopen.header.size = sizeof (struct req_lib_lck_resourceopen);
>  	req_lib_lck_resourceopen.header.id = MESSAGE_REQ_LCK_RESOURCEOPEN;
>  
> -	marshall_to_mar_name_t (&req_lib_lck_resourceopen.lockResourceName, (SaNameT *)lockResourceName);
> +	marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourceopen.lockResourceName, (SaNameT *)lockResourceName);
>  
>  	memcpy (&lckResourceInstance->lockResourceName, lockResourceName, sizeof(SaNameT));
>  	req_lib_lck_resourceopen.resourceOpenFlags = resourceOpenFlags;
> @@ -759,7 +760,7 @@ saLckResourceOpenAsync (
>  	lckResourceInstance->lckResourceHandle = lckResourceHandle;
>  	lckResourceInstance->resourceOpenFlags = resourceOpenFlags;
>  
> -	marshall_to_mar_name_t (&req_lib_lck_resourceopen.lockResourceName, 
> +	marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourceopen.lockResourceName, 
>  			(SaNameT *)lockResourceName);
>  	memcpy (&lckResourceInstance->lockResourceName, lockResourceName, sizeof (SaNameT));
>  	req_lib_lck_resourceopen.header.size = sizeof (struct req_lib_lck_resourceopen);
> @@ -812,7 +813,7 @@ saLckResourceClose (
>  
>  	req_lib_lck_resourceclose.header.size = sizeof (struct req_lib_lck_resourceclose);
>  	req_lib_lck_resourceclose.header.id = MESSAGE_REQ_LCK_RESOURCECLOSE;
> -	marshall_to_mar_name_t (&req_lib_lck_resourceclose.lockResourceName,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourceclose.lockResourceName,
>  		&lckResourceInstance->lockResourceName);
>  	req_lib_lck_resourceclose.resourceHandle = lckResourceHandle;
>  
> @@ -880,7 +881,7 @@ saLckResourceLock (
>  
>  	req_lib_lck_resourcelock.header.size = sizeof (struct req_lib_lck_resourcelock);
>  	req_lib_lck_resourcelock.header.id = MESSAGE_REQ_LCK_RESOURCELOCK;
> -	marshall_to_mar_name_t (&req_lib_lck_resourcelock.lockResourceName,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourcelock.lockResourceName,
>  		&lckResourceInstance->lockResourceName);
>  	req_lib_lck_resourcelock.lockMode = lockMode;
>  	req_lib_lck_resourcelock.lockFlags = lockFlags;
> @@ -973,7 +974,7 @@ saLckResourceLockAsync (
>  
>  	req_lib_lck_resourcelock.header.size = sizeof (struct req_lib_lck_resourcelock);
>  	req_lib_lck_resourcelock.header.id = MESSAGE_REQ_LCK_RESOURCELOCKASYNC;
> -	marshall_to_mar_name_t (&req_lib_lck_resourcelock.lockResourceName,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourcelock.lockResourceName,
>  		&lckResourceInstance->lockResourceName);
>  	req_lib_lck_resourcelock.lockMode = lockMode;
>  	req_lib_lck_resourcelock.lockFlags = lockFlags;
> @@ -1043,7 +1044,7 @@ saLckResourceUnlock (
>  		return (error);
>  	}
>  
> -	marshall_to_mar_name_t (&req_lib_lck_resourceunlock.lockResourceName,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourceunlock.lockResourceName,
>  		&lckResourceInstance->lockResourceName);
>  
>  	saHandleInstancePut (&lckResourceHandleDatabase,
> @@ -1101,7 +1102,7 @@ saLckResourceUnlockAsync (
>  		return (error);
>  	}
>  
> -	marshall_to_mar_name_t (&req_lib_lck_resourceunlock.lockResourceName,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_lck_resourceunlock.lockResourceName,
>  		&lckResourceInstance->lockResourceName);
>  
>  	saHandleInstancePut (&lckResourceHandleDatabase,
> @@ -1149,7 +1150,7 @@ saLckLockPurge (
>  
>  	req_lib_lck_lockpurge.header.size = sizeof (struct req_lib_lck_lockpurge);
>  	req_lib_lck_lockpurge.header.id = MESSAGE_REQ_LCK_LOCKPURGE;
> -	marshall_to_mar_name_t (&req_lib_lck_lockpurge.lockResourceName,
> +	marshall_SaNameT_to_mar_name_t (&req_lib_lck_lockpurge.lockResourceName,
>  		&lckResourceInstance->lockResourceName);
>  
>  	pthread_mutex_lock (lckResourceInstance->response_mutex);
> -- 
> 1.5.6
> 
> _______________________________________________
> Openais mailing list
> Openais at lists.linux-foundation.org
> https://lists.linux-foundation.org/mailman/listinfo/openais



More information about the Openais mailing list