Просмотр исходного кода

votequorum: rename NODE_FLAGS_QDEVICE to NODE_FLAGS_QDEVICE_REGISTERED

make the flag name explicit

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
Fabio M. Di Nitto 13 лет назад
Родитель
Сommit
4621a6cd02

+ 14 - 14
exec/votequorum.c

@@ -153,12 +153,12 @@ static int votequorum_exec_send_reconfigure(uint8_t param, unsigned int nodeid,
  * votequorum internal node status/view
  */
 
-#define NODE_FLAGS_QUORATE        1
-#define NODE_FLAGS_LEAVING        2
-#define NODE_FLAGS_WFASTATUS      4
-#define NODE_FLAGS_FIRST          8
-#define NODE_FLAGS_QDEVICE       16
-#define NODE_FLAGS_QDEVICE_STATE 32
+#define NODE_FLAGS_QUORATE              1
+#define NODE_FLAGS_LEAVING              2
+#define NODE_FLAGS_WFASTATUS            4
+#define NODE_FLAGS_FIRST                8
+#define NODE_FLAGS_QDEVICE_REGISTERED  16
+#define NODE_FLAGS_QDEVICE_STATE       32
 
 #define NODEID_QDEVICE 0
 
@@ -550,7 +550,7 @@ static void decode_flags(uint32_t flags)
 		   (flags & NODE_FLAGS_LEAVING)?"Yes":"No",
 		   (flags & NODE_FLAGS_WFASTATUS)?"Yes":"No",
 		   (flags & NODE_FLAGS_FIRST)?"Yes":"No",
-		   (flags & NODE_FLAGS_QDEVICE)?"Yes":"No",
+		   (flags & NODE_FLAGS_QDEVICE_REGISTERED)?"Yes":"No",
 		   (flags & NODE_FLAGS_QDEVICE_STATE)?"Yes":"No");
 }
 
@@ -1444,7 +1444,7 @@ static void message_handler_req_exec_votequorum_qdevice_reg (
 		if ((!strncmp(req_exec_quorum_qdevice_reg->qdevice_name,
 			      qdevice_name, VOTEQUORUM_MAX_QDEVICE_NAME_LEN))) {
 			qdevice_is_registered = 1;
-			us->flags |= NODE_FLAGS_QDEVICE;
+			us->flags |= NODE_FLAGS_QDEVICE_REGISTERED;
 			votequorum_exec_send_nodeinfo(NODEID_QDEVICE);
 			votequorum_exec_send_nodeinfo(us->node_id);
 		} else {
@@ -1464,7 +1464,7 @@ static void message_handler_req_exec_votequorum_qdevice_reg (
 		list_iterate(tmp, &cluster_members_list) {
 			node = list_entry(tmp, struct cluster_node, list);
 			if ((node->state == NODESTATE_MEMBER) &&
-			    (node->flags & NODE_FLAGS_QDEVICE)) {
+			    (node->flags & NODE_FLAGS_QDEVICE_REGISTERED)) {
 				wipe_qdevice_name = 0;
 			}
 		}
@@ -1965,7 +1965,7 @@ static void message_handler_req_lib_votequorum_getinfo (void *conn, const void *
 		}
 
 		if (((qdevice_is_registered) && (qdevice->state == NODESTATE_MEMBER)) ||
-		    ((node->flags & NODE_FLAGS_QDEVICE) && (node->flags & NODE_FLAGS_QDEVICE_STATE))) {
+		    ((node->flags & NODE_FLAGS_QDEVICE_REGISTERED) && (node->flags & NODE_FLAGS_QDEVICE_STATE))) {
 			total_votes += qdevice->votes;
 		}
 
@@ -1997,8 +1997,8 @@ static void message_handler_req_lib_votequorum_getinfo (void *conn, const void *
 		if (allow_downscale) {
 			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_LEAVE_REMOVE;
 		}
-		if (node->flags & NODE_FLAGS_QDEVICE) {
-			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_QDEVICE;
+		if (node->flags & NODE_FLAGS_QDEVICE_REGISTERED) {
+			res_lib_votequorum_getinfo.flags |= VOTEQUORUM_INFO_QDEVICE_REGISTERED;
 		}
 	} else {
 		error = CS_ERR_NOT_EXIST;
@@ -2237,7 +2237,7 @@ static void message_handler_req_lib_votequorum_qdevice_unregister (void *conn,
 			qdevice_timer_set = 0;
 		}
 		qdevice_is_registered = 0;
-		us->flags &= ~NODE_FLAGS_QDEVICE;
+		us->flags &= ~NODE_FLAGS_QDEVICE_REGISTERED;
 		us->flags &= ~NODE_FLAGS_QDEVICE_STATE;
 		qdevice->state = NODESTATE_DEAD;
 		votequorum_exec_send_nodeinfo(us->node_id);
@@ -2354,7 +2354,7 @@ static void message_handler_req_lib_votequorum_qdevice_getinfo (void *conn,
 	    (nodeid != NODEID_QDEVICE)) {
 		node = find_node_by_nodeid(req_lib_votequorum_qdevice_getinfo->nodeid);
 		if ((node) &&
-		    (node->flags & NODE_FLAGS_QDEVICE)) {
+		    (node->flags & NODE_FLAGS_QDEVICE_REGISTERED)) {
 			int state = 0;
 
 			if (node->flags & NODE_FLAGS_QDEVICE_STATE) {

+ 1 - 1
include/corosync/ipc_votequorum.h

@@ -123,7 +123,7 @@ struct res_lib_votequorum_status {
 #define VOTEQUORUM_INFO_LAST_MAN_STANDING       8
 #define VOTEQUORUM_INFO_AUTO_TIE_BREAKER       16
 #define VOTEQUORUM_INFO_LEAVE_REMOVE           32
-#define VOTEQUORUM_INFO_QDEVICE                64
+#define VOTEQUORUM_INFO_QDEVICE_REGISTERED     64
 
 struct res_lib_votequorum_getinfo {
 	struct qb_ipc_response_header header __attribute__((aligned(8)));

+ 1 - 1
include/corosync/votequorum.h

@@ -48,7 +48,7 @@ typedef uint64_t votequorum_handle_t;
 #define VOTEQUORUM_INFO_LAST_MAN_STANDING       8
 #define VOTEQUORUM_INFO_AUTO_TIE_BREAKER       16
 #define VOTEQUORUM_INFO_LEAVE_REMOVE           32
-#define VOTEQUORUM_INFO_QDEVICE                64
+#define VOTEQUORUM_INFO_QDEVICE_REGISTERED     64
 
 #define VOTEQUORUM_NODEID_QDEVICE 0
 #define VOTEQUORUM_MAX_QDEVICE_NAME_LEN 255

+ 1 - 1
man/votequorum_getinfo.3.in

@@ -80,7 +80,7 @@ The flags are defined as:
 #define VOTEQUORUM_INFO_LAST_MAN_STANDING       8
 #define VOTEQUORUM_INFO_AUTO_TIE_BREAKER       16
 #define VOTEQUORUM_INFO_LEAVE_REMOVE           32
-#define VOTEQUORUM_INFO_QDEVICE                64
+#define VOTEQUORUM_INFO_QDEVICE_REGISTERED     64
 .fi
 .PP
 The members starting node_ hold information specific to the requested nodeid, the other are

+ 1 - 1
tools/corosync-quorumtool.c

@@ -432,7 +432,7 @@ static int display_quorum_data(int is_quorate, uint32_t nodeid,
 		if (info.flags & VOTEQUORUM_INFO_LAST_MAN_STANDING) printf("LastManStanding ");
 		if (info.flags & VOTEQUORUM_INFO_AUTO_TIE_BREAKER) printf("AutoTieBreaker ");
 		if (info.flags & VOTEQUORUM_INFO_LEAVE_REMOVE) printf("LeaveRemove ");
-		if (info.flags & VOTEQUORUM_INFO_QDEVICE) {
+		if (info.flags & VOTEQUORUM_INFO_QDEVICE_REGISTERED) {
 			printf("Qdevice ");
 			display_qdevice = 1;
 		} else {