Re: [PATCH 4/9] votequorum: drop HASSTATE/SETSTATE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reviewed-by: Steven Dake <sdake@xxxxxxxxxx>

On 01/12/2012 04:49 AM, Fabio M. Di Nitto wrote:
> From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>
> 
> this is a leftover from killing DISALLOWED
> 
> Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
> ---
> :100644 100644 f7a7544... 26ebced... M	include/corosync/ipc_votequorum.h
> :100644 100644 b9f8154... b52cad0... M	include/corosync/votequorum.h
> :100644 100644 9ad0b5d... 1746845... M	lib/libvotequorum.versions
> :100644 100644 095f7c4... 240ada2... M	lib/votequorum.c
> :100644 100644 b21577b... 62dca5b... M	services/votequorum.c
> :100644 100644 0d22082... 61c35e3... M	test/testvotequorum1.c
> :100644 100644 37ae4cb... 69b0a5a... M	tools/corosync-quorumtool.c
>  include/corosync/ipc_votequorum.h |    6 +---
>  include/corosync/votequorum.h     |   11 +--------
>  lib/libvotequorum.versions        |    1 -
>  lib/votequorum.c                  |   39 ----------------------------------
>  services/votequorum.c             |   42 ++++--------------------------------
>  test/testvotequorum1.c            |    2 -
>  tools/corosync-quorumtool.c       |    1 -
>  7 files changed, 9 insertions(+), 93 deletions(-)
> 
> diff --git a/include/corosync/ipc_votequorum.h b/include/corosync/ipc_votequorum.h
> index f7a7544..26ebced 100644
> --- a/include/corosync/ipc_votequorum.h
> +++ b/include/corosync/ipc_votequorum.h
> @@ -47,7 +47,6 @@ enum req_votequorum_types {
>  	MESSAGE_REQ_VOTEQUORUM_QDISK_UNREGISTER,
>  	MESSAGE_REQ_VOTEQUORUM_QDISK_POLL,
>  	MESSAGE_REQ_VOTEQUORUM_QDISK_GETINFO,
> -	MESSAGE_REQ_VOTEQUORUM_SETSTATE,
>  	MESSAGE_REQ_VOTEQUORUM_LEAVING,
>  	MESSAGE_REQ_VOTEQUORUM_TRACKSTART,
>  	MESSAGE_REQ_VOTEQUORUM_TRACKSTOP
> @@ -103,9 +102,8 @@ struct res_lib_votequorum_status {
>  	struct qb_ipc_response_header header __attribute__((aligned(8)));
>  };
>  
> -#define VOTEQUORUM_INFO_FLAG_HASSTATE   1
> -#define VOTEQUORUM_INFO_FLAG_TWONODE    2
> -#define VOTEQUORUM_INFO_FLAG_QUORATE    4
> +#define VOTEQUORUM_INFO_FLAG_TWONODE    1
> +#define VOTEQUORUM_INFO_FLAG_QUORATE    2
>  
>  struct res_lib_votequorum_getinfo {
>  	struct qb_ipc_response_header header __attribute__((aligned(8)));
> diff --git a/include/corosync/votequorum.h b/include/corosync/votequorum.h
> index b9f8154..b52cad0 100644
> --- a/include/corosync/votequorum.h
> +++ b/include/corosync/votequorum.h
> @@ -44,9 +44,8 @@ typedef uint64_t votequorum_handle_t;
>  
>  #define VOTEQUORUM_MAX_QDISK_NAME_LEN 255
>  
> -#define VOTEQUORUM_INFO_FLAG_HASSTATE   1
> -#define VOTEQUORUM_INFO_FLAG_TWONODE    2
> -#define VOTEQUORUM_INFO_FLAG_QUORATE    4
> +#define VOTEQUORUM_INFO_FLAG_TWONODE    1
> +#define VOTEQUORUM_INFO_FLAG_QUORATE    2
>  
>  #define VOTEQUORUM_NODEID_US 0
>  #define VOTEQUORUM_NODEID_QDEVICE -1
> @@ -182,12 +181,6 @@ cs_error_t votequorum_qdisk_getinfo (
>  	struct votequorum_qdisk_info *info);
>  
>  /**
> - * Set the "hasstate" bit for this node
> - */
> -cs_error_t votequorum_setstate (
> -	votequorum_handle_t handle);
> -
> -/**
>   * Track node and quorum changes
>   */
>  cs_error_t votequorum_trackstart (
> diff --git a/lib/libvotequorum.versions b/lib/libvotequorum.versions
> index 9ad0b5d..1746845 100644
> --- a/lib/libvotequorum.versions
> +++ b/lib/libvotequorum.versions
> @@ -11,7 +11,6 @@ COROSYNC_VOTEQUORUM_1.0 {
>  		votequorum_qdisk_unregister;
>  		votequorum_qdisk_poll;
>  		votequorum_qdisk_getinfo;
> -		votequorum_setstate;
>  		votequorum_leaving;
>  		votequorum_trackstart;
>  		votequorum_trackstop;
> diff --git a/lib/votequorum.c b/lib/votequorum.c
> index 095f7c4..240ada2 100644
> --- a/lib/votequorum.c
> +++ b/lib/votequorum.c
> @@ -448,45 +448,6 @@ error_exit:
>  	return (error);
>  }
>  
> -cs_error_t votequorum_setstate (
> -	votequorum_handle_t handle)
> -{
> -	cs_error_t error;
> -	struct votequorum_inst *votequorum_inst;
> -	struct iovec iov;
> -	struct req_lib_votequorum_general req_lib_votequorum_general;
> -	struct res_lib_votequorum_status res_lib_votequorum_status;
> -
> -	error = hdb_error_to_cs(hdb_handle_get (&votequorum_handle_t_db, handle, (void *)&votequorum_inst));
> -	if (error != CS_OK) {
> -		return (error);
> -	}
> -
> -	req_lib_votequorum_general.header.size = sizeof (struct req_lib_votequorum_general);
> -	req_lib_votequorum_general.header.id = MESSAGE_REQ_VOTEQUORUM_SETSTATE;
> -
> -	iov.iov_base = (char *)&req_lib_votequorum_general;
> -	iov.iov_len = sizeof (struct req_lib_votequorum_general);
> -
> -        error = qb_to_cs_error(qb_ipcc_sendv_recv (
> -		votequorum_inst->c,
> -		&iov,
> -		1,
> -                &res_lib_votequorum_status,
> -		sizeof (struct res_lib_votequorum_status), CS_IPC_TIMEOUT_MS));
> -
> -	if (error != CS_OK) {
> -		goto error_exit;
> -	}
> -
> -	error = res_lib_votequorum_status.header.error;
> -
> -error_exit:
> -	hdb_handle_put (&votequorum_handle_t_db, handle);
> -
> -	return (error);
> -}
> -
>  cs_error_t votequorum_leaving (
>  	votequorum_handle_t handle)
>  {
> diff --git a/services/votequorum.c b/services/votequorum.c
> index b21577b..62dca5b 100644
> --- a/services/votequorum.c
> +++ b/services/votequorum.c
> @@ -92,10 +92,9 @@ enum quorum_message_req_types {
>  };
>  
>  #define NODE_FLAGS_BEENDOWN         1
> -#define NODE_FLAGS_HASSTATE         8
> -#define NODE_FLAGS_QDISK           16
> -#define NODE_FLAGS_REMOVED         32
> -#define NODE_FLAGS_US              64
> +#define NODE_FLAGS_QDISK            8
> +#define NODE_FLAGS_REMOVED         16
> +#define NODE_FLAGS_US              32
>  
>  #define NODEID_US 0
>  #define NODEID_QDEVICE -1
> @@ -210,9 +209,6 @@ static void message_handler_req_lib_votequorum_qdisk_poll (void *conn,
>  static void message_handler_req_lib_votequorum_qdisk_getinfo (void *conn,
>  							      const void *message);
>  
> -static void message_handler_req_lib_votequorum_setstate (void *conn,
> -							 const void *message);
> -
>  static void message_handler_req_lib_votequorum_leaving (void *conn,
>  							const void *message);
>  static void message_handler_req_lib_votequorum_trackstart (void *conn,
> @@ -264,18 +260,14 @@ static struct corosync_lib_handler quorum_lib_service[] =
>  		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
>  	},
>  	{ /* 7 */
> -		.lib_handler_fn		= message_handler_req_lib_votequorum_setstate,
> -		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
> -	},
> -	{ /* 8 */
>  		.lib_handler_fn		= message_handler_req_lib_votequorum_leaving,
>  		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
>  	},
> -	{ /* 9 */
> +	{ /* 8 */
>  		.lib_handler_fn		= message_handler_req_lib_votequorum_trackstart,
>  		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
>  	},
> -	{ /* 10 */
> +	{ /* 9 */
>  		.lib_handler_fn		= message_handler_req_lib_votequorum_trackstop,
>  		.flow_control		= COROSYNC_LIB_FLOW_CONTROL_NOT_REQUIRED
>  	}
> @@ -1281,9 +1273,6 @@ static void message_handler_req_lib_votequorum_getinfo (void *conn, const void *
>  		res_lib_votequorum_getinfo.flags = 0;
>  		res_lib_votequorum_getinfo.nodeid = node->node_id;
>  
> -		if (us->flags & NODE_FLAGS_HASSTATE) {
> -			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_FLAG_HASSTATE;
> -		}
>  		if (two_node) {
>  			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_FLAG_TWONODE;
>  		}
> @@ -1579,27 +1568,6 @@ static void message_handler_req_lib_votequorum_qdisk_getinfo (void *conn,
>  	LEAVE();
>  }
>  
> -static void message_handler_req_lib_votequorum_setstate (void *conn,
> -							 const void *message)
> -{
> -	struct res_lib_votequorum_status res_lib_votequorum_status;
> -	cs_error_t error = CS_OK;
> -
> -	ENTER();
> -
> -	us->flags |= NODE_FLAGS_HASSTATE;
> -
> -	/*
> -	 * send status
> -	 */
> -	res_lib_votequorum_status.header.size = sizeof(res_lib_votequorum_status);
> -	res_lib_votequorum_status.header.id = MESSAGE_RES_VOTEQUORUM_STATUS;
> -	res_lib_votequorum_status.header.error = error;
> -	corosync_api->ipc_response_send(conn, &res_lib_votequorum_status, sizeof(res_lib_votequorum_status));
> -
> -	LEAVE();
> -}
> -
>  static void message_handler_req_lib_votequorum_trackstart (void *conn,
>  							   const void *message)
>  {
> diff --git a/test/testvotequorum1.c b/test/testvotequorum1.c
> index 0d22082..61c35e3 100644
> --- a/test/testvotequorum1.c
> +++ b/test/testvotequorum1.c
> @@ -128,7 +128,6 @@ int main(int argc, char *argv[])
>  		printf("total votes      %d\n", info.total_votes);
>  		printf("quorum           %d\n", info.quorum);
>  		printf("flags            ");
> -		if (info.flags & VOTEQUORUM_INFO_FLAG_HASSTATE) printf("HasState ");
>  		if (info.flags & VOTEQUORUM_INFO_FLAG_TWONODE) printf("2Node ");
>  		if (info.flags & VOTEQUORUM_INFO_FLAG_QUORATE) printf("Quorate ");
>  		printf("\n");
> @@ -154,7 +153,6 @@ int main(int argc, char *argv[])
>  			printf("total votes      %d\n", info.total_votes);
>  			printf("votequorum           %d\n", info.quorum);
>  			printf("flags            ");
> -			if (info.flags & VOTEQUORUM_INFO_FLAG_HASSTATE) printf("HasState ");
>  			if (info.flags & VOTEQUORUM_INFO_FLAG_TWONODE) printf("2Node ");
>  			if (info.flags & VOTEQUORUM_INFO_FLAG_QUORATE) printf("Quorate ");
>  			printf("\n");
> diff --git a/tools/corosync-quorumtool.c b/tools/corosync-quorumtool.c
> index 37ae4cb..69b0a5a 100644
> --- a/tools/corosync-quorumtool.c
> +++ b/tools/corosync-quorumtool.c
> @@ -315,7 +315,6 @@ static int display_quorum_data(int is_quorate)
>  		printf("Total votes:      %d\n", info.total_votes);
>  		printf("Quorum:           %d %s\n", info.quorum, info.flags & VOTEQUORUM_INFO_FLAG_QUORATE?" ":"Activity blocked");
>  		printf("Flags:            ");
> -		if (info.flags & VOTEQUORUM_INFO_FLAG_HASSTATE) printf("HasState ");
>  		if (info.flags & VOTEQUORUM_INFO_FLAG_TWONODE) printf("2Node ");
>  		if (info.flags & VOTEQUORUM_INFO_FLAG_QUORATE) printf("Quorate ");
>  		printf("\n");

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux