osaf/services/saf/amf/amfd/include/si.h | 1 +
osaf/services/saf/amf/amfd/include/si_dep.h | 1 -
osaf/services/saf/amf/amfd/si_dep.cc | 41 ++++++++++++++--------------
3 files changed, 21 insertions(+), 22 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
@@ -154,6 +154,7 @@ public:
void stop_tol_timer(AVD_CL_CB *cb);
bool in_sponsor_list(const AVD_SI_DEP *rec);
void take_action_on_dependents();
+ void update_self_si_dep_state();
private:
diff --git a/osaf/services/saf/amf/amfd/include/si_dep.h
b/osaf/services/saf/amf/amfd/include/si_dep.h
--- a/osaf/services/saf/amf/amfd/include/si_dep.h
+++ b/osaf/services/saf/amf/amfd/include/si_dep.h
@@ -83,7 +83,6 @@ extern void avd_sidep_update_depstate_si
extern bool avd_sidep_si_dependency_exists_within_su(const AVD_SU *su);
extern bool avd_sidep_quiesced_done_for_all_dependents(const AVD_SI *si, const
AVD_SU *su);
extern void sidep_si_take_action(AVD_SI *si);
-extern void sidep_update_si_self_dep_state(AVD_SI *si);
extern void sidep_process_ready_to_unassign_depstate(AVD_SI *dep_si);
extern void avd_sidep_sg_take_action(AVD_SG *sg);
#endif
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
@@ -696,7 +696,7 @@ void AVD_SI::screen_si_dependencies()
TRACE_ENTER2("%s", name.value);
/*update the si_dep_state of si based on assignement states of its
sponsors*/
- sidep_update_si_self_dep_state(this);
+ update_self_si_dep_state();
/*update si_dep_state of dependent sis of si.*/
if (num_dependents)
@@ -756,7 +756,7 @@ void avd_sidep_assign_evh(AVD_CL_CB *cb,
sidep_dependentsi_role_failover(dep_si);
} else {
/*Check sponsors state once agian then take action*/
- sidep_update_si_self_dep_state(dep_si);
+ dep_si->update_self_si_dep_state();
if (dep_si->si_dep_state == AVD_SI_READY_TO_ASSIGN) {
if ((sidep_sg_red_si_process_assignment(avd_cb, dep_si)
== NCSCC_RC_FAILURE) &&
(dep_si->num_dependents != 0)) {
@@ -2227,8 +2227,7 @@ void AVD_SI::update_dependents_states()
*/
if ((dep_si->sg_of_si->sg_fsm_state == AVD_SG_FSM_STABLE) ||
(dep_si->sg_of_si == sg_of_si))
- sidep_update_si_self_dep_state(dep_si);
-
+ dep_si->update_self_si_dep_state();
}
}
@@ -2241,20 +2240,20 @@ void AVD_SI::update_dependents_states()
* @return Nothing
*
**/
-void sidep_update_si_self_dep_state(AVD_SI *si)
+void AVD_SI::update_self_si_dep_state()
{
bool all_sponsors_assgnd = false;
- TRACE_ENTER2("sponsor si:'%s'", si->name.value);
+ TRACE_ENTER2("sponsor si:'%s'", name.value);
/*Any dependent SI is never expcted in this state when screening is
going on.
In such situation do not update si_dep_state. It will be taken care
during failover*/
- if (si->si_dep_state == AVD_SI_FAILOVER_UNDER_PROGRESS) {
+ if (si_dep_state == AVD_SI_FAILOVER_UNDER_PROGRESS) {
AVD_SPONS_SI_NODE *spons;
/*If atleast one sponsor is unassigned, unassign the dependent*/
- for (spons = si->spons_si_list; spons; spons = spons->next) {
+ for (spons = spons_si_list; spons; spons = spons->next) {
if (spons->si->list_of_sisu == NULL) {
- si->set_dep_state(AVD_SI_READY_TO_UNASSIGN);
+ set_dep_state(AVD_SI_READY_TO_UNASSIGN);
goto done;
}
}
@@ -2262,41 +2261,41 @@ void sidep_update_si_self_dep_state(AVD_
}
/*Check assignment states and si_dep_states of all sponsors*/
- all_sponsors_assgnd = si->all_sponsors_active();
+ all_sponsors_assgnd = all_sponsors_active();
if (all_sponsors_assgnd == true) {
/*All the sponsors of this SI are assigned or no sponsors at
all.*/
- if (si->si_active() == true) {
+ if (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)
+ set_dep_state(AVD_SI_ASSIGNED);
+ if (tol_timer_count > 0)
/*Stop any toleracne timer if running */
- si->stop_tol_timer(avd_cb);
+ stop_tol_timer(avd_cb);
} else {
/*SI is unassigned. Modify its si_dep_state to
AVD_SI_NO_DEPENDENCY if it does not have any sponsor
otherwise modify it to AVD_SI_READY_TO_ASSIGN.
*/
- if (si->spons_si_list == NULL)
- si->set_dep_state(AVD_SI_NO_DEPENDENCY);
+ if (spons_si_list == NULL)
+ set_dep_state(AVD_SI_NO_DEPENDENCY);
else
- si->set_dep_state(AVD_SI_READY_TO_ASSIGN);
+ set_dep_state(AVD_SI_READY_TO_ASSIGN);
}
}
else {
/*It means atleast one sponsor is unassigned.*/
- if (si->si_active() == true) {
+ if (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
*/
- if (si->si_dep_state != AVD_SI_UNASSIGNING_DUE_TO_DEP)
- si->set_dep_state(AVD_SI_READY_TO_UNASSIGN);
+ if (si_dep_state != AVD_SI_UNASSIGNING_DUE_TO_DEP)
+ set_dep_state(AVD_SI_READY_TO_UNASSIGN);
}
else
- si->set_dep_state(AVD_SI_SPONSOR_UNASSIGNED);
+ set_dep_state(AVD_SI_SPONSOR_UNASSIGNED);
}
done:
TRACE_LEAVE();
------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel