2
* Copyright 2004-2012 Red Hat, Inc.
4
* This copyrighted material is made available to anyone wishing to use,
5
* modify, copy, or redistribute it subject to the terms and conditions
6
* of the GNU General Public License v2 or (at your option) any later version.
9
#ifndef _LIBDLMCONTROL_H_
10
#define _LIBDLMCONTROL_H_
12
#define DLMC_DUMP_SIZE (1024 * 1024)
14
#define DLMC_NF_MEMBER 0x00000001 /* node is member in cg */
15
#define DLMC_NF_START 0x00000002 /* start message recvd for cg */
16
#define DLMC_NF_DISALLOWED 0x00000004 /* node disallowed in cg */
17
#define DLMC_NF_NEED_FENCING 0x00000008
18
#define DLMC_NF_CHECK_FS 0x00000010
26
uint64_t fail_walltime;
27
uint64_t fail_monotime;
30
#define DLMC_LS_WAIT_RINGID 1
31
#define DLMC_LS_WAIT_QUORUM 2
32
#define DLMC_LS_WAIT_FENCING 3
33
#define DLMC_LS_WAIT_FSDONE 4
40
int wait_condition; /* DLMC_LS_WAIT or needed message count */
41
int wait_messages; /* 0 no, 1 yes */
43
uint32_t combined_seq;
46
#define DLMC_LF_JOINING 0x00000001
47
#define DLMC_LF_LEAVING 0x00000002
48
#define DLMC_LF_KERNEL_STOPPED 0x00000004
49
#define DLMC_LF_FS_REGISTERED 0x00000008
50
#define DLMC_LF_NEED_PLOCKS 0x00000010
51
#define DLMC_LF_SAVE_PLOCKS 0x00000020
53
struct dlmc_lockspace {
54
struct dlmc_change cg_prev; /* completed change (started_change) */
55
struct dlmc_change cg_next; /* in-progress change (changes list) */
58
char name[DLM_LOCKSPACE_LEN+1];
61
/* dlmc_lockspace_nodes() types
63
MEMBERS: members in completed (prev) change,
64
zero if there's no completed (prev) change
65
NEXT: members in in-progress (next) change,
66
zero if there's no in-progress (next) change
67
ALL: NEXT + nonmembers if there's an in-progress (next) change,
68
MEMBERS + nonmembers if there's no in-progress (next) change, but
69
there is a completed (prev) change
70
nonmembers if there's no in-progress (next) or completed (prev)
73
dlmc_node_info() returns info for in-progress (next) change, if one exists,
74
otherwise it returns info for completed (prev) change.
77
#define DLMC_NODES_ALL 1
78
#define DLMC_NODES_MEMBERS 2
79
#define DLMC_NODES_NEXT 3
81
#define DLMC_STATUS_VERBOSE 0x00000001
83
int dlmc_dump_debug(char *buf);
84
int dlmc_dump_config(char *buf);
85
int dlmc_dump_log_plock(char *buf);
86
int dlmc_dump_plocks(char *name, char *buf);
87
int dlmc_lockspace_info(char *lsname, struct dlmc_lockspace *ls);
88
int dlmc_node_info(char *lsname, int nodeid, struct dlmc_node *node);
89
int dlmc_lockspaces(int max, int *count, struct dlmc_lockspace *lss);
90
int dlmc_lockspace_nodes(char *lsname, int type, int max, int *count,
91
struct dlmc_node *nodes);
92
int dlmc_print_status(uint32_t flags);
94
#define DLMC_RESULT_REGISTER 1
95
#define DLMC_RESULT_NOTIFIED 2
97
int dlmc_fs_connect(void);
98
void dlmc_fs_disconnect(int fd);
99
int dlmc_fs_register(int fd, char *name);
100
int dlmc_fs_unregister(int fd, char *name);
101
int dlmc_fs_notified(int fd, char *name, int nodeid);
102
int dlmc_fs_result(int fd, char *name, int *type, int *nodeid, int *result);
104
int dlmc_deadlock_check(char *name);
105
int dlmc_fence_ack(char *name);