osaf/services/saf/amf/amfd/include/si.h | 1 +
osaf/services/saf/amf/amfd/si_dep.cc | 27 +++++++++++++--------------
2 files changed, 14 insertions(+), 14 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
@@ -143,6 +143,7 @@ public:
// SI SI dependency related functions
void set_dep_state(AVD_SI_DEP_STATE state);
bool si_active();
+ bool all_sponsors_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
@@ -160,7 +160,6 @@
AmfDb<std::pair<std::string, std::string>, AVD_SI_DEP> *sidep_db = NULL;
/* static function prototypes */
-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 uint32_t sidep_sg_red_si_process_assignment(AVD_CL_CB *cb, AVD_SI *si);
@@ -591,7 +590,7 @@ void avd_sidep_tol_tmr_evh(AVD_CL_CB *cb
/* Before starting unassignment process of SI, check once again whether
* sponsor SIs are assigned back,if so move the SI state to ASSIGNED
state
*/
- if (avd_sidep_all_sponsors_active(si)) {
+ if (si->all_sponsors_active() == true) {
/*Since all the sponsors got assigned we can assign this
dependent.
If dependent si is already assigned then mark dep state to
AVD_SI_ASSGINED
and stop other tolerance timers.
@@ -631,14 +630,14 @@ done:
* NOTES:
*
**************************************************************************/
-bool avd_sidep_all_sponsors_active(AVD_SI *si)
+bool AVD_SI::all_sponsors_active()
{
bool spons_state = true;
AVD_SPONS_SI_NODE *spons_si_node = NULL;
- TRACE_ENTER2("'%s'", si->name.value);
+ TRACE_ENTER2("'%s'", name.value);
- for (spons_si_node = si->spons_si_list; spons_si_node != NULL;
+ for (spons_si_node = spons_si_list; spons_si_node != NULL;
spons_si_node = spons_si_node->next) {
if (spons_si_node->si->si_active() == false) {
spons_state = false;
@@ -811,7 +810,7 @@ void sidep_si_dep_start_unassign(AVD_CL_
* sponsors are moved back to assigned state, if so it is not required
to
* initiate the unassignment process for the (dependent) SI.
*/
- if (avd_sidep_all_sponsors_active(si)) {
+ if (si->all_sponsors_active() == true) {
si->set_dep_state(AVD_SI_ASSIGNED);
goto done;
}
@@ -929,7 +928,7 @@ void sidep_take_action_on_dependents(AVD
if ((dep_si->sg_of_si->sg_fsm_state != AVD_SG_FSM_STABLE) &&
(dep_si->sg_of_si != si->sg_of_si)) {
if ((dep_si->si_dep_state ==
AVD_SI_FAILOVER_UNDER_PROGRESS) &&
-
(avd_sidep_all_sponsors_active(dep_si))) {
+ (dep_si->all_sponsors_active() ==
true)) {
dep_si->set_dep_state(AVD_SI_READY_TO_ASSIGN);
sidep_dependentsi_role_failover(dep_si);
}
@@ -1242,7 +1241,7 @@ static AVD_SI_DEP *sidep_new(SaNameT *si
all its sponsors assignment status. Possibly a call to
*_chosen_asgn() after this
may be made and thus it will help in avoiding re-screening in
*_chosen_asgn().
*/
- if (avd_sidep_all_sponsors_active(sidep->dep_si))
+ if (sidep->dep_si->all_sponsors_active() == true)
sidep->dep_si->set_dep_state(AVD_SI_READY_TO_ASSIGN);
else
sidep->dep_si->set_dep_state(AVD_SI_SPONSOR_UNASSIGNED);
@@ -1923,7 +1922,7 @@ static void sidep_dependentsi_role_failo
*/
for (susi = stdby_su->list_of_susi;susi !=
NULL;susi = susi->su_next) {
if (susi->si->spons_si_list) {
- if
(!avd_sidep_all_sponsors_active(si)) {
+ if (si->all_sponsors_active()
== false) {
TRACE("SI's sponsors
are not yet assigned");
goto done;
}
@@ -1956,7 +1955,7 @@ static void sidep_dependentsi_role_failo
*/
for (susi = stdby_su->list_of_susi;susi != NULL;susi =
susi->su_next) {
if (susi->si->spons_si_list) {
- if (!avd_sidep_all_sponsors_active(si))
{
+ if (si->all_sponsors_active() == false)
{
TRACE("SI's sponsors are not
yet assigned");
goto done;
}
@@ -1976,7 +1975,7 @@ static void sidep_dependentsi_role_failo
}
break;
case SA_AMF_N_WAY_REDUNDANCY_MODEL:
- if (avd_sidep_all_sponsors_active(si)) {
+ if (si->all_sponsors_active() == true) {
/* identify the most preferred standby su for this si */
susi = avd_find_preferred_standby_susi(si);
if (susi) {
@@ -2087,7 +2086,7 @@ void avd_sidep_send_active_to_dependents
TRACE("dependent si:%s
dep_si->si_dep_state:%d",dep_si->name.value,dep_si->si_dep_state);
if(dep_si->si_dep_state == AVD_SI_FAILOVER_UNDER_PROGRESS) {
- if (!avd_sidep_all_sponsors_active(dep_si))
+ if (dep_si->all_sponsors_active() == false)
/* Some of the sponsors are not yet in Active
state */
continue;
AVD_SU_SI_REL *sisu;
@@ -2265,9 +2264,9 @@ void sidep_update_si_self_dep_state(AVD_
}
/*Check assignment states and si_dep_states of all sponsors*/
- all_sponsors_assgnd = avd_sidep_all_sponsors_active(si);
+ all_sponsors_assgnd = si->all_sponsors_active();
- if (all_sponsors_assgnd) {
+ if (all_sponsors_assgnd == true) {
/*All the sponsors of this SI are assigned or no sponsors at
all.*/
if (si->si_active() == true) {
------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel