corosync 3.1.7
Data Structures | Macros | Enumerations | Functions | Variables
exec/votequorum.c File Reference
#include <config.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdint.h>
#include <unistd.h>
#include <qb/qblist.h>
#include <qb/qbipc_common.h>
#include "quorum.h"
#include <corosync/corodefs.h>
#include <corosync/logsys.h>
#include <corosync/coroapi.h>
#include <corosync/icmap.h>
#include <corosync/votequorum.h>
#include <corosync/ipc_votequorum.h>
#include "service.h"
#include "util.h"
#include "votequorum.h"
Include dependency graph for exec/votequorum.c:

Go to the source code of this file.

Data Structures

struct  req_exec_quorum_nodeinfo
 
struct  req_exec_quorum_reconfigure
 
struct  req_exec_quorum_qdevice_reg
 
struct  req_exec_quorum_qdevice_reconfigure
 
struct  cluster_node
 
struct  quorum_pd
 

Macros

#define DEFAULT_LMS_WIN   10000
 
#define MESSAGE_REQ_EXEC_VOTEQUORUM_NODEINFO   0
 
#define MESSAGE_REQ_EXEC_VOTEQUORUM_RECONFIGURE   1
 
#define MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_REG   2
 
#define MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_RECONFIGURE   3
 
#define VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES   1
 
#define VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES   2
 
#define VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA   3
 
#define VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER   0
 
#define VOTEQUORUM_QDEVICE_OPERATION_REGISTER   1
 
#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_ALIVE   32
 
#define NODE_FLAGS_QDEVICE_CAST_VOTE   64
 
#define NODE_FLAGS_QDEVICE_MASTER_WINS   128
 
#define max(a, b)   (((a) > (b)) ? (a) : (b))
 
#define VOTEQUORUM_READCONFIG_STARTUP   0
 
#define VOTEQUORUM_READCONFIG_RUNTIME   1
 

Enumerations

enum  { ATB_NONE , ATB_LOWEST , ATB_HIGHEST , ATB_LIST }
 
enum  nodestate_t { NODESTATE_MEMBER =1 , NODESTATE_DEAD , NODESTATE_LEAVING }
 

Functions

 LOGSYS_DECLARE_SUBSYS ("VOTEQ")
 
struct req_exec_quorum_nodeinfo __attribute__ ((packed))
 
struct qb_ipc_request_header header __attribute__ ((aligned(8)))
 
struct corosync_service_enginevotequorum_get_service_engine_ver0 (void)
 
char * votequorum_init (struct corosync_api_v1 *api, quorum_set_quorate_fn_t q_set_quorate_fn)
 

Variables

typedef __attribute__
 
uint32_t nodeid
 
uint32_t votes
 
uint32_t expected_votes
 
uint32_t flags
 
uint32_t value
 
uint8_t param
 
uint8_t _pad0
 
uint8_t _pad1
 
uint8_t _pad2
 
uint32_t operation
 
char oldname [VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
 
char newname [VOTEQUORUM_QDEVICE_MAX_NAME_LEN]
 

Macro Definition Documentation

◆ DEFAULT_LMS_WIN

#define DEFAULT_LMS_WIN   10000

Definition at line 89 of file exec/votequorum.c.

◆ max

#define max (   a,
 
)    (((a) > (b)) ? (a) : (b))

Definition at line 433 of file exec/votequorum.c.

◆ MESSAGE_REQ_EXEC_VOTEQUORUM_NODEINFO

#define MESSAGE_REQ_EXEC_VOTEQUORUM_NODEINFO   0

Definition at line 144 of file exec/votequorum.c.

◆ MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_RECONFIGURE

#define MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_RECONFIGURE   3

Definition at line 147 of file exec/votequorum.c.

◆ MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_REG

#define MESSAGE_REQ_EXEC_VOTEQUORUM_QDEVICE_REG   2

Definition at line 146 of file exec/votequorum.c.

◆ MESSAGE_REQ_EXEC_VOTEQUORUM_RECONFIGURE

#define MESSAGE_REQ_EXEC_VOTEQUORUM_RECONFIGURE   1

Definition at line 145 of file exec/votequorum.c.

◆ NODE_FLAGS_FIRST

#define NODE_FLAGS_FIRST   8

Definition at line 172 of file exec/votequorum.c.

◆ NODE_FLAGS_LEAVING

#define NODE_FLAGS_LEAVING   2

Definition at line 170 of file exec/votequorum.c.

◆ NODE_FLAGS_QDEVICE_ALIVE

#define NODE_FLAGS_QDEVICE_ALIVE   32

Definition at line 174 of file exec/votequorum.c.

◆ NODE_FLAGS_QDEVICE_CAST_VOTE

#define NODE_FLAGS_QDEVICE_CAST_VOTE   64

Definition at line 175 of file exec/votequorum.c.

◆ NODE_FLAGS_QDEVICE_MASTER_WINS

#define NODE_FLAGS_QDEVICE_MASTER_WINS   128

Definition at line 176 of file exec/votequorum.c.

◆ NODE_FLAGS_QDEVICE_REGISTERED

#define NODE_FLAGS_QDEVICE_REGISTERED   16

Definition at line 173 of file exec/votequorum.c.

◆ NODE_FLAGS_QUORATE

#define NODE_FLAGS_QUORATE   1

Definition at line 169 of file exec/votequorum.c.

◆ NODE_FLAGS_WFASTATUS

#define NODE_FLAGS_WFASTATUS   4

Definition at line 171 of file exec/votequorum.c.

◆ VOTEQUORUM_QDEVICE_OPERATION_REGISTER

#define VOTEQUORUM_QDEVICE_OPERATION_REGISTER   1

Definition at line 163 of file exec/votequorum.c.

◆ VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER

#define VOTEQUORUM_QDEVICE_OPERATION_UNREGISTER   0

Definition at line 162 of file exec/votequorum.c.

◆ VOTEQUORUM_READCONFIG_RUNTIME

#define VOTEQUORUM_READCONFIG_RUNTIME   1

Definition at line 1241 of file exec/votequorum.c.

◆ VOTEQUORUM_READCONFIG_STARTUP

#define VOTEQUORUM_READCONFIG_STARTUP   0

Definition at line 1240 of file exec/votequorum.c.

◆ VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA

#define VOTEQUORUM_RECONFIG_PARAM_CANCEL_WFA   3

Definition at line 155 of file exec/votequorum.c.

◆ VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES

#define VOTEQUORUM_RECONFIG_PARAM_EXPECTED_VOTES   1

Definition at line 153 of file exec/votequorum.c.

◆ VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES

#define VOTEQUORUM_RECONFIG_PARAM_NODE_VOTES   2

Definition at line 154 of file exec/votequorum.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ATB_NONE 
ATB_LOWEST 
ATB_HIGHEST 
ATB_LIST 

Definition at line 85 of file exec/votequorum.c.

◆ nodestate_t

Enumerator
NODESTATE_MEMBER 
NODESTATE_DEAD 
NODESTATE_LEAVING 

Definition at line 178 of file exec/votequorum.c.

Function Documentation

◆ __attribute__() [1/2]

struct qb_ipc_request_header header __attribute__::__attribute__ ( (aligned(8))  )

◆ __attribute__() [2/2]

struct req_exec_quorum_nodeinfo __attribute__ ( (packed)  )

◆ LOGSYS_DECLARE_SUBSYS()

LOGSYS_DECLARE_SUBSYS ( "VOTEQ"  )

◆ votequorum_get_service_engine_ver0()

struct corosync_service_engine * votequorum_get_service_engine_ver0 ( void  )

Definition at line 416 of file exec/votequorum.c.

◆ votequorum_init()

char * votequorum_init ( struct corosync_api_v1 api,
quorum_set_quorate_fn_t  q_set_quorate_fn 
)

Definition at line 2486 of file exec/votequorum.c.

Variable Documentation

◆ __attribute__

typedef __attribute__

◆ _pad0

uint8_t _pad0

Definition at line 4 of file exec/votequorum.c.

◆ _pad1

uint8_t _pad1

Definition at line 5 of file exec/votequorum.c.

◆ _pad2

uint8_t _pad2

Definition at line 6 of file exec/votequorum.c.

◆ expected_votes

uint32_t expected_votes

Definition at line 3 of file exec/votequorum.c.

◆ flags

uint32_t flags

Definition at line 4 of file exec/votequorum.c.

Referenced by totempg_stats_clear(), and totemsrp_stats_clear().

◆ newname

Definition at line 2 of file exec/votequorum.c.

Referenced by votequorum_qdevice_update().

◆ nodeid

uint32_t nodeid

Definition at line 1 of file exec/votequorum.c.

◆ oldname

Definition at line 1 of file exec/votequorum.c.

Referenced by votequorum_qdevice_update().

◆ operation

uint32_t operation

Definition at line 1 of file exec/votequorum.c.

◆ param

uint8_t param

◆ value

uint32_t value

◆ votes

uint32_t votes

Definition at line 2 of file exec/votequorum.c.