corosync 3.1.7
Data Structures | Functions
lib/quorum.c File Reference
#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/uio.h>
#include <errno.h>
#include <qb/qbipcc.h>
#include <corosync/corotypes.h>
#include <corosync/corodefs.h>
#include <corosync/hdb.h>
#include <corosync/quorum.h>
#include <corosync/ipc_quorum.h>
#include "util.h"
Include dependency graph for lib/quorum.c:

Go to the source code of this file.

Data Structures

struct  quorum_inst
 

Functions

 DECLARE_HDB_DATABASE (quorum_handle_t_db, quorum_inst_free)
 
cs_error_t quorum_initialize (quorum_handle_t *handle, quorum_callbacks_t *callbacks, uint32_t *quorum_type)
 Create a new quorum connection. More...
 
cs_error_t quorum_model_initialize (quorum_handle_t *handle, quorum_model_t model, quorum_model_data_t *model_data, uint32_t *quorum_type, void *context)
 
cs_error_t quorum_finalize (quorum_handle_t handle)
 Close the quorum handle. More...
 
cs_error_t quorum_getquorate (quorum_handle_t handle, int *quorate)
 Get quorum information. More...
 
cs_error_t quorum_fd_get (quorum_handle_t handle, int *fd)
 Get a file descriptor on which to poll. More...
 
cs_error_t quorum_context_get (quorum_handle_t handle, const void **context)
 quorum_context_get More...
 
cs_error_t quorum_context_set (quorum_handle_t handle, const void *context)
 quorum_context_set More...
 
cs_error_t quorum_trackstart (quorum_handle_t handle, unsigned int flags)
 Track node and quorum changes. More...
 
cs_error_t quorum_trackstop (quorum_handle_t handle)
 quorum_trackstop More...
 
cs_error_t quorum_dispatch (quorum_handle_t handle, cs_dispatch_flags_t dispatch_types)
 Dispatch messages and configuration changes. More...
 

Function Documentation

◆ DECLARE_HDB_DATABASE()

DECLARE_HDB_DATABASE ( quorum_handle_t_db  ,
quorum_inst_free   
)

◆ quorum_context_get()

cs_error_t quorum_context_get ( quorum_handle_t  handle,
const void **  context 
)

quorum_context_get

Parameters
handle
context
Returns

Definition at line 299 of file lib/quorum.c.

References hdb_error_to_cs().

◆ quorum_context_set()

cs_error_t quorum_context_set ( quorum_handle_t  handle,
const void *  context 
)

quorum_context_set

Parameters
handle
context
Returns

Definition at line 318 of file lib/quorum.c.

References hdb_error_to_cs().

◆ quorum_dispatch()

cs_error_t quorum_dispatch ( quorum_handle_t  handle,
cs_dispatch_flags_t  dispatch_types 
)

Dispatch messages and configuration changes.

Parameters
handle
dispatch_types
Returns

Definition at line 418 of file lib/quorum.c.

References CS_DISPATCH_ALL, CS_DISPATCH_BLOCKING, CS_DISPATCH_ONE, CS_DISPATCH_ONE_NONBLOCKING, CS_ERR_INVALID_PARAM, hdb_error_to_cs(), IPC_DISPATCH_SIZE, and ring_id.

◆ quorum_fd_get()

cs_error_t quorum_fd_get ( quorum_handle_t  handle,
int *  fd 
)

Get a file descriptor on which to poll.

Note
quorum_handle_t is NOT a file descriptor and may not be used directly.
Parameters
handle
fd
Returns

Definition at line 279 of file lib/quorum.c.

References hdb_error_to_cs().

◆ quorum_finalize()

cs_error_t quorum_finalize ( quorum_handle_t  handle)

Close the quorum handle.

Parameters
handle
Returns

Definition at line 209 of file lib/quorum.c.

References hdb_error_to_cs().

◆ quorum_getquorate()

cs_error_t quorum_getquorate ( quorum_handle_t  handle,
int *  quorate 
)

Get quorum information.

Parameters
handle
quorate
Returns

Definition at line 237 of file lib/quorum.c.

References hdb_error_to_cs().

◆ quorum_initialize()

cs_error_t quorum_initialize ( quorum_handle_t handle,
quorum_callbacks_t callbacks,
uint32_t *  quorum_type 
)

Create a new quorum connection.

Parameters
handle
callbacks
quorum_type
Returns

Definition at line 73 of file lib/quorum.c.

◆ quorum_model_initialize()

cs_error_t quorum_model_initialize ( quorum_handle_t handle,
quorum_model_t  model,
quorum_model_data_t model_data,
uint32_t *  quorum_type,
void *  context 
)

Definition at line 90 of file lib/quorum.c.

◆ quorum_trackstart()

cs_error_t quorum_trackstart ( quorum_handle_t  handle,
unsigned int  flags 
)

Track node and quorum changes.

Parameters
handle
flags
Returns

Definition at line 338 of file lib/quorum.c.

References hdb_error_to_cs().

◆ quorum_trackstop()

cs_error_t quorum_trackstop ( quorum_handle_t  handle)

quorum_trackstop

Parameters
handle
Returns

Definition at line 379 of file lib/quorum.c.

References hdb_error_to_cs().