diff --git a/pengine/allocate.c b/pengine/allocate.c index 230674701ac..8b1ce53d50d 100644 --- a/pengine/allocate.c +++ b/pengine/allocate.c @@ -96,6 +96,34 @@ resource_alloc_functions_t resource_class_alloc_functions[] = { } }; +gboolean +update_action_flags(action_t * action, enum pe_action_flags flags) +{ + static unsigned long calls = 0; + gboolean changed = FALSE; + gboolean clear = is_set(flags, pe_action_clear); + enum pe_action_flags last = action->flags; + + if (clear) { + pe_clear_action_bit(action, flags); + } else { + pe_set_action_bit(action, flags); + } + + if (last != action->flags) { + calls++; + changed = TRUE; + /* Useful for tracking down _who_ changed a specific flag */ + /* CRM_ASSERT(calls != 534); */ + clear_bit(flags, pe_action_clear); + crm_trace("%s on %s: %sset flags 0x%.6x (was 0x%.6x, now 0x%.6x, %lu)", + action->uuid, action->node ? action->node->details->uname : "[none]", + clear ? "un-" : "", flags, last, action->flags, calls); + } + + return changed; +} + static gboolean check_rsc_parameters(resource_t * rsc, node_t * node, xmlNode * rsc_entry, gboolean active_here, pe_working_set_t * data_set) diff --git a/pengine/allocate.h b/pengine/allocate.h index 86734c17eaf..fb0614a372a 100644 --- a/pengine/allocate.h +++ b/pengine/allocate.h @@ -170,28 +170,6 @@ extern enum pe_graph_flags clone_update_actions(action_t * first, action_t * the enum pe_action_flags flags, enum pe_action_flags filter, enum pe_ordering type); -static inline gboolean -update_action_flags(action_t * action, enum pe_action_flags flags) -{ - gboolean changed = FALSE; - gboolean clear = is_set(flags, pe_action_clear); - enum pe_action_flags last = action->flags; - - if (clear) { - pe_clear_action_bit(action, flags); - } else { - pe_set_action_bit(action, flags); - } - - if (last != action->flags) { - changed = TRUE; - clear_bit(flags, pe_action_clear); - crm_trace("%s on %s: %sset flags 0x%.6x (was 0x%.6x, now 0x%.6x)", - action->uuid, action->node ? action->node->details->uname : "[none]", - clear ? "un-" : "", flags, last, action->flags); - } - - return changed; -} +gboolean update_action_flags(action_t * action, enum pe_action_flags flags); #endif