osaf/services/saf/amf/amfd/include/si.h | 1 +
osaf/services/saf/amf/amfd/si_dep.cc | 25 ++++++++++++-------------
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/osaf/services/saf/amf/amfd/include/si.h
b/osaf/services/saf/amf/amfd/include/si.h
--- a/osaf/services/saf/amf/amfd/include/si.h
+++ b/osaf/services/saf/amf/amfd/include/si.h
@@ -142,6 +142,7 @@ public:
// SI SI dependency related functions
void set_dep_state(AVD_SI_DEP_STATE state);
+ bool si_active();
private:
AVD_SI(const AVD_SI&);
diff --git a/osaf/services/saf/amf/amfd/si_dep.cc
b/osaf/services/saf/amf/amfd/si_dep.cc
--- a/osaf/services/saf/amf/amfd/si_dep.cc
+++ b/osaf/services/saf/amf/amfd/si_dep.cc
@@ -163,7 +163,6 @@ AmfDb<std::pair<std::string, std::string
static bool avd_sidep_all_sponsors_active(AVD_SI *si);
static void sidep_update_si_dep_state_for_spons_unassign(AVD_CL_CB *cb, AVD_SI
*dep_si, AVD_SI_DEP *si_dep_rec);
static uint32_t sidep_unassign_dependent(AVD_CL_CB *cb, AVD_SI *si);
-static bool sidep_is_si_active(AVD_SI *si);
static uint32_t sidep_sg_red_si_process_assignment(AVD_CL_CB *cb, AVD_SI *si);
static uint32_t sidep_si_dep_state_evt_send(AVD_CL_CB *cb, AVD_SI *si,
AVD_EVT_TYPE evt_type);
static uint32_t sidep_cyclic_dep_find(AVD_SI_DEP *sidep);
@@ -237,14 +236,14 @@ void AVD_SI::set_dep_state(AVD_SI_DEP_ST
* NOTES:
*
**************************************************************************/
-bool sidep_is_si_active(AVD_SI *si)
+bool AVD_SI::si_active()
{
AVD_SU_SI_REL *susi = NULL;
bool si_active = false;
- TRACE_ENTER2("'%s'", si->name.value);
+ TRACE_ENTER2("'%s'", name.value);
- for (susi = si->list_of_sisu; susi != AVD_SU_SI_REL_NULL; susi =
susi->si_next) {
+ for (susi = list_of_sisu; susi != AVD_SU_SI_REL_NULL; susi =
susi->si_next) {
if (((susi->state == SA_AMF_HA_ACTIVE) || (susi->state ==
SA_AMF_HA_QUIESCING)) &&
(susi->fsm == AVD_SU_SI_STATE_ASGND) &&
(susi->si->si_dep_state !=
AVD_SI_FAILOVER_UNDER_PROGRESS)) {
@@ -475,7 +474,7 @@ uint32_t sidep_sg_red_si_process_assignm
goto done;
}
- if (sidep_is_si_active(si)) {
+ if (si->si_active() == true) {
si->set_dep_state(AVD_SI_ASSIGNED);
rc = NCSCC_RC_SUCCESS;
}
@@ -597,7 +596,7 @@ void avd_sidep_tol_tmr_evh(AVD_CL_CB *cb
If dependent si is already assigned then mark dep state to
AVD_SI_ASSGINED
and stop other tolerance timers.
*/
- if (sidep_is_si_active(si))
+ if (si->si_active() == true)
si->set_dep_state(AVD_SI_ASSIGNED);
else
sidep_sg_red_si_process_assignment(cb, si);
@@ -606,7 +605,7 @@ void avd_sidep_tol_tmr_evh(AVD_CL_CB *cb
/*Atleast one sponsor is unassigned. If dependent is already
unassigned then
mark its dep state to SPONSOR_UNASSGINED otherwise unassign
it.
*/
- if (sidep_is_si_active(si)) {
+ if (si->si_active() == true) {
LOG_NO("Unassigning due to dep'%s'",si->name.value);
sidep_unassign_dependent(cb, si);
}
@@ -641,7 +640,7 @@ bool avd_sidep_all_sponsors_active(AVD_S
for (spons_si_node = si->spons_si_list; spons_si_node != NULL;
spons_si_node = spons_si_node->next) {
- if (!sidep_is_si_active(spons_si_node->si)) {
+ if (spons_si_node->si->si_active() == false) {
spons_state = false;
break;
}
@@ -1648,7 +1647,7 @@ bool avd_sidep_is_si_failover_possible(A
break;
} else if ((sisu->state == SA_AMF_HA_QUIESCED)
&&
(sisu->fsm ==
AVD_SU_SI_STATE_ASGND) &&
- (sisu->su == su) &&
!sidep_is_si_active(sisu->si)) {
+ (sisu->su == su) &&
(sisu->si->si_active() == false)) {
/* If sponsor is quiesced in the same
SU and not active in
any other SU, it means failover of
sponsor is still pending.
*/
@@ -2271,7 +2270,7 @@ void sidep_update_si_self_dep_state(AVD_
if (all_sponsors_assgnd) {
/*All the sponsors of this SI are assigned or no sponsors at
all.*/
- if (sidep_is_si_active(si)) {
+ if (si->si_active() == true) {
/* Since SI is assigned set its si_dep_state to
AVD_SI_ASSIGNED.*/
si->set_dep_state(AVD_SI_ASSIGNED);
if (si->tol_timer_count > 0)
@@ -2291,7 +2290,7 @@ void sidep_update_si_self_dep_state(AVD_
else {
/*It means atleast one sponsor is unassigned.*/
- if (sidep_is_si_active(si)) {
+ if (si->si_active() == true) {
/*Since SI is assigned, set dep state to
AVD_SI_READY_TO_UASSIGN.
Later while taking action, start the tolerance timer
or unassign SI
depending upon the value of saAmfToleranceTime for
unassigned sponsors
@@ -2366,7 +2365,7 @@ void sidep_si_take_action(AVD_SI *si)
/*a SI not participating in SI dependency or
a SI having dependent(s) and no sponsor*/
- if ((!sidep_is_si_active(si)) &&
+ if ((si->si_active() == false) &&
(si->saAmfSIAdminState ==
SA_AMF_ADMIN_UNLOCKED)) {
/*This is a SI with no sponsor. Assign it.*/
sidep_sg_red_si_process_assignment(avd_cb, si);
@@ -2433,7 +2432,7 @@ void sidep_process_ready_to_unassign_dep
if (si_dep_rec == NULL)
goto done;
- if (sidep_is_si_active(spons_si)) {
+ if (spons_si->si_active() == true) {
if (si_dep_rec->si_dep_timer.is_active == true) {
avd_stop_tmr(avd_cb, &si_dep_rec->si_dep_timer);
if(dep_si->tol_timer_count > 0)
------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel