This source file includes following definitions.
- pcmk__is_clone
- pcmk__is_unique_clone
- pcmk__is_anonymous_clone
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_COMMON_CLONE_INTERNAL__H
11 #define PCMK__CRM_COMMON_CLONE_INTERNAL__H
12
13 #include <stdbool.h>
14 #include <crm/common/scheduler_types.h>
15 #include <crm/common/resources.h>
16
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21
22 enum pcmk__clone_flags {
23
24 pcmk__clone_ordered = (1 << 0),
25
26
27 pcmk__clone_promotion_added = (1 << 1),
28
29
30 pcmk__clone_promotion_constrained = (1 << 2),
31 };
32
33
34
35
36
37
38
39
40
41
42
43 static inline bool
44 pcmk__is_clone(const pcmk_resource_t *rsc)
45 {
46 return (rsc != NULL) && (rsc->variant == pcmk_rsc_variant_clone);
47 }
48
49
50
51
52
53
54
55
56
57 static inline bool
58 pcmk__is_unique_clone(const pcmk_resource_t *rsc)
59 {
60 return pcmk__is_clone(rsc) && pcmk_is_set(rsc->flags, pcmk_rsc_unique);
61 }
62
63
64
65
66
67
68
69
70
71 static inline bool
72 pcmk__is_anonymous_clone(const pcmk_resource_t *rsc)
73 {
74 return pcmk__is_clone(rsc) && !pcmk_is_set(rsc->flags, pcmk_rsc_unique);
75 }
76
77 #ifdef __cplusplus
78 }
79 #endif
80
81 #endif