~ubuntu-branches/ubuntu/trusty/dlm/trusty

« back to all changes in this revision

Viewing changes to dlm_controld/libdlmcontrol.h

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2013-07-23 15:50:10 UTC
  • Revision ID: package-import@ubuntu.com-20130723155010-khpwf6vc04wjho2a
Tags: upstream-4.0.1
ImportĀ upstreamĀ versionĀ 4.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2004-2012 Red Hat, Inc.
 
3
 *
 
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.
 
7
 */
 
8
 
 
9
#ifndef _LIBDLMCONTROL_H_
 
10
#define _LIBDLMCONTROL_H_
 
11
 
 
12
#define DLMC_DUMP_SIZE          (1024 * 1024)
 
13
 
 
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
 
19
 
 
20
struct dlmc_node {
 
21
        int nodeid;
 
22
        uint32_t flags;
 
23
        uint32_t added_seq;
 
24
        uint32_t removed_seq;
 
25
        int fail_reason;
 
26
        uint64_t fail_walltime;
 
27
        uint64_t fail_monotime;
 
28
};
 
29
 
 
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
 
34
 
 
35
struct dlmc_change {
 
36
        int member_count;
 
37
        int joined_count;
 
38
        int remove_count;
 
39
        int failed_count;
 
40
        int wait_condition;     /* DLMC_LS_WAIT or needed message count */
 
41
        int wait_messages;      /* 0 no, 1 yes */
 
42
        uint32_t seq;
 
43
        uint32_t combined_seq;
 
44
};
 
45
 
 
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
 
52
 
 
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) */
 
56
        uint32_t flags;
 
57
        uint32_t global_id;
 
58
        char name[DLM_LOCKSPACE_LEN+1];
 
59
};
 
60
 
 
61
/* dlmc_lockspace_nodes() types
 
62
 
 
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)
 
71
            change (possible?)
 
72
 
 
73
   dlmc_node_info() returns info for in-progress (next) change, if one exists,
 
74
   otherwise it returns info for completed (prev) change.
 
75
*/
 
76
 
 
77
#define DLMC_NODES_ALL          1
 
78
#define DLMC_NODES_MEMBERS      2
 
79
#define DLMC_NODES_NEXT         3
 
80
 
 
81
#define DLMC_STATUS_VERBOSE     0x00000001
 
82
 
 
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);
 
93
 
 
94
#define DLMC_RESULT_REGISTER    1
 
95
#define DLMC_RESULT_NOTIFIED    2
 
96
 
 
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);
 
103
 
 
104
int dlmc_deadlock_check(char *name);
 
105
int dlmc_fence_ack(char *name);
 
106
 
 
107
#endif
 
108