[PATCH 03/25] votequorum: rename NODE_FLAGS_QDEVICE to NODE_FLAGS_QDEVICE_REGISTERED

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

 



From: "Fabio M. Di Nitto" <fdinitto@xxxxxxxxxx>

make the flag name explicit

Signed-off-by: Fabio M. Di Nitto <fdinitto@xxxxxxxxxx>
---
:100644 100644 3362c66... cdb03b9... M	exec/votequorum.c
:100644 100644 eee7e3c... 0036a5c... M	include/corosync/ipc_votequorum.h
:100644 100644 09bb949... ba2434b... M	include/corosync/votequorum.h
:100644 100644 4f36c2c... 5ffc26f... M	man/votequorum_getinfo.3.in
:100644 100644 0d461ab... 43b9b64... M	tools/corosync-quorumtool.c
 exec/votequorum.c                 |   28 ++++++++++++++--------------
 include/corosync/ipc_votequorum.h |    2 +-
 include/corosync/votequorum.h     |    2 +-
 man/votequorum_getinfo.3.in       |    2 +-
 tools/corosync-quorumtool.c       |    2 +-
 5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/exec/votequorum.c b/exec/votequorum.c
index 3362c66..cdb03b9 100644
--- a/exec/votequorum.c
+++ b/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) {
diff --git a/include/corosync/ipc_votequorum.h b/include/corosync/ipc_votequorum.h
index eee7e3c..0036a5c 100644
--- a/include/corosync/ipc_votequorum.h
+++ b/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)));
diff --git a/include/corosync/votequorum.h b/include/corosync/votequorum.h
index 09bb949..ba2434b 100644
--- a/include/corosync/votequorum.h
+++ b/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
diff --git a/man/votequorum_getinfo.3.in b/man/votequorum_getinfo.3.in
index 4f36c2c..5ffc26f 100644
--- a/man/votequorum_getinfo.3.in
+++ b/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
diff --git a/tools/corosync-quorumtool.c b/tools/corosync-quorumtool.c
index 0d461ab..43b9b64 100644
--- a/tools/corosync-quorumtool.c
+++ b/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 {
-- 
1.7.7.6

_______________________________________________
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