Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F3687084
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/include/crm/common/resources_internal.h b/include/crm/common/resources_internal.h
index fc867f0f76..c78d610fdd 100644
--- a/include/crm/common/resources_internal.h
+++ b/include/crm/common/resources_internal.h
@@ -1,30 +1,74 @@
/*
* Copyright 2024 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
* This source code is licensed under the GNU Lesser General Public License
* version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
*/
#ifndef PCMK__CRM_COMMON_RESOURCES_INTERNAL__H
#define PCMK__CRM_COMMON_RESOURCES_INTERNAL__H
-#include <crm/common/resources.h> // enum rsc_recovery_type
+#include <crm/common/resources.h> // enum rsc_recovery_type
+#include <crm/common/scheduler_types.h> // pcmk_node_t, pcmk_resource_t
#ifdef __cplusplus
extern "C" {
#endif
+/*!
+ * \internal
+ * \brief Set resource flags
+ *
+ * \param[in,out] resource Resource to set flags for
+ * \param[in] flags_to_set Group of enum pcmk_rsc_flags to set
+ */
+#define pcmk__set_rsc_flags(resource, flags_to_set) do { \
+ (resource)->flags = pcmk__set_flags_as(__func__, __LINE__, \
+ LOG_TRACE, "Resource", (resource)->id, (resource)->flags, \
+ (flags_to_set), #flags_to_set); \
+ } while (0)
+
+/*!
+ * \internal
+ * \brief Clear resource flags
+ *
+ * \param[in,out] resource Resource to clear flags for
+ * \param[in] flags_to_clear Group of enum pcmk_rsc_flags to clear
+ */
+#define pcmk__clear_rsc_flags(resource, flags_to_clear) do { \
+ (resource)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
+ LOG_TRACE, "Resource", (resource)->id, (resource)->flags, \
+ (flags_to_clear), #flags_to_clear); \
+ } while (0)
+
// Implementation of pcmk__resource_private_t
struct pcmk__resource_private {
const pcmk_rsc_methods_t *fns; // Resource object methods
};
const char *pcmk__multiply_active_text(enum rsc_recovery_type recovery);
+/*!
+ * \internal
+ * \brief Get node where resource is currently active (if any)
+ *
+ * \param[in] rsc Resource to check
+ *
+ * \return Node that \p rsc is active on, if any, otherwise NULL
+ */
+static inline pcmk_node_t *
+pcmk__current_node(const pcmk_resource_t *rsc)
+{
+ if (rsc == NULL) {
+ return NULL;
+ }
+ return rsc->private->fns->active_node(rsc, NULL, NULL);
+}
+
#ifdef __cplusplus
}
#endif
#endif // PCMK__CRM_COMMON_RESOURCES_INTERNAL__H
diff --git a/include/crm/common/roles_internal.h b/include/crm/common/roles_internal.h
index b987c395d3..b0b1693794 100644
--- a/include/crm/common/roles_internal.h
+++ b/include/crm/common/roles_internal.h
@@ -1,72 +1,26 @@
/*
* Copyright 2004-2024 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
* This source code is licensed under the GNU Lesser General Public License
* version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
*/
#ifndef PCMK__CRM_COMMON_ROLES_INTERNAL__H
#define PCMK__CRM_COMMON_ROLES_INTERNAL__H
-#include <crm/common/scheduler_types.h> // pcmk_node_t, pcmk_resource_t
-#include <crm/common/resources_internal.h> // struct pcmk__resource_private
-
#ifdef __cplusplus
extern "C" {
#endif
// String equivalents of enum rsc_role_e
#define PCMK__ROLE_UNKNOWN "Unknown"
#define PCMK__ROLE_UNPROMOTED_LEGACY "Slave"
#define PCMK__ROLE_PROMOTED_LEGACY "Master"
-/*!
- * \internal
- * \brief Set resource flags
- *
- * \param[in,out] resource Resource to set flags for
- * \param[in] flags_to_set Group of enum pcmk_rsc_flags to set
- */
-#define pcmk__set_rsc_flags(resource, flags_to_set) do { \
- (resource)->flags = pcmk__set_flags_as(__func__, __LINE__, \
- LOG_TRACE, "Resource", (resource)->id, (resource)->flags, \
- (flags_to_set), #flags_to_set); \
- } while (0)
-
-/*!
- * \internal
- * \brief Clear resource flags
- *
- * \param[in,out] resource Resource to clear flags for
- * \param[in] flags_to_clear Group of enum pcmk_rsc_flags to clear
- */
-#define pcmk__clear_rsc_flags(resource, flags_to_clear) do { \
- (resource)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
- LOG_TRACE, "Resource", (resource)->id, (resource)->flags, \
- (flags_to_clear), #flags_to_clear); \
- } while (0)
-
-/*!
- * \internal
- * \brief Get node where resource is currently active (if any)
- *
- * \param[in] rsc Resource to check
- *
- * \return Node that \p rsc is active on, if any, otherwise NULL
- */
-static inline pcmk_node_t *
-pcmk__current_node(const pcmk_resource_t *rsc)
-{
- if (rsc == NULL) {
- return NULL;
- }
- return rsc->private->fns->active_node(rsc, NULL, NULL);
-}
-
#ifdef __cplusplus
}
#endif
#endif // PCMK__CRM_COMMON_ROLES_INTERNAL__H
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Apr 21, 6:51 PM (20 h, 39 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1665248
Default Alt Text
(5 KB)
Attached To
Mode
rP Pacemaker
Attached
Detach File
Event Timeline
Log In to Comment