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        |  24 ++++++++++++------------
 3 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
@@ -153,6 +153,7 @@ public:
        uint32_t unassign_dependent(AVD_CL_CB *cb);
        void stop_tol_timer(AVD_CL_CB *cb);
        bool in_sponsor_list(const AVD_SI_DEP *rec);
+       void take_action_on_dependents();
 
 
 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
@@ -82,7 +82,6 @@ extern void avd_sidep_update_depstate_su
 extern void avd_sidep_update_depstate_si_failover(AVD_SI *si, AVD_SU *su);
 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_take_action_on_dependents(AVD_SI *si);
 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);
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
@@ -210,7 +210,7 @@ void AVD_SI::set_dep_state(AVD_SI_DEP_ST
                                 (si_dep_state == AVD_SI_READY_TO_ASSIGN))) {
                        /*Check if this SI is a sponsor SI for some other SI 
then 
                          take appropriate action on dependents.*/
-                       sidep_take_action_on_dependents(this);
+                       take_action_on_dependents();
                }
                /*If a dependent si moves to AVD_SI_READY_TO_UNASSIGN state 
                  then start the tolerance timer.*/
@@ -760,7 +760,7 @@ void avd_sidep_assign_evh(AVD_CL_CB *cb,
                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)) {
-                               sidep_take_action_on_dependents(dep_si);
+                               dep_si->take_action_on_dependents();
                        }
                }
                else
@@ -891,21 +891,21 @@ done:
 }
 
 /*****************************************************************************
- * Function: sidep_take_action_on_dependents 
+ * Function: take_action_on_dependents 
  *
  * Purpose:  Upon SI is assigned/unassigned and if this SI turns out to be 
  *           sponsor SI for some of the SIs (dependents),then update the states
  *           of dependent SIs accordingly (either to AVD_SI_READY_TO_UNASSIGN 
/ 
  *           AVD_SI_TOL_TIMER_RUNNING states).
  *
- * Input:    si - ptr to AVD_SI struct (sponsor SI).
+ * Input:
  *
  * Returns:  Nothing
  *
  * NOTES:
  * 
  **************************************************************************/
-void sidep_take_action_on_dependents(AVD_SI *si)
+void AVD_SI::take_action_on_dependents()
 {
        TRACE_ENTER();
 
@@ -913,7 +913,7 @@ void sidep_take_action_on_dependents(AVD
                        it != sidep_db->end(); it++) {
                const AVD_SI_DEP *sidep = it->second;
 
-               if (sidep->spons_si != si)
+               if (sidep->spons_si != this)
                        continue;
 
                AVD_SI *dep_si = avd_si_get(&sidep->dep_name);
@@ -924,7 +924,7 @@ void sidep_take_action_on_dependents(AVD
                   based on updated si_dep_state action is taken.
                 */
                if ((dep_si->sg_of_si->sg_fsm_state != AVD_SG_FSM_STABLE) &&
-                               (dep_si->sg_of_si != si->sg_of_si)) {
+                               (dep_si->sg_of_si != sg_of_si)) {
                        if ((dep_si->si_dep_state == 
AVD_SI_FAILOVER_UNDER_PROGRESS) &&
                                        (dep_si->all_sponsors_active() == 
true)) {
                                dep_si->set_dep_state(AVD_SI_READY_TO_ASSIGN);
@@ -2320,7 +2320,7 @@ void sidep_si_take_action(AVD_SI *si)
                case AVD_SI_ASSIGNED:
                        /* SI is assigned. Assign all the unassigned 
dependents*/
                        if (si->num_dependents != 0)
-                               sidep_take_action_on_dependents(si);
+                               si->take_action_on_dependents();
                        break;
                case AVD_SI_READY_TO_ASSIGN:
                        /*If this SI is an sponsor, action will be taken on its
@@ -2346,8 +2346,8 @@ void sidep_si_take_action(AVD_SI *si)
                        break;
                case AVD_SI_SPONSOR_UNASSIGNED:
                        /*This SI is unassigned so take action on dependents*/
-                       if (si->num_dependents) 
-                               sidep_take_action_on_dependents(si);
+                       if (si->num_dependents > 0)
+                               si->take_action_on_dependents();
                        break;
                case AVD_SI_TOL_TIMER_RUNNING:
                        /*Action will be taken at the expiry of tolerance 
timer.*/
@@ -2367,10 +2367,10 @@ void sidep_si_take_action(AVD_SI *si)
                                /*This is a SI with no sponsor. Assign it.*/
                                sidep_sg_red_si_process_assignment(avd_cb, si);
                        }  
-                       if (si->num_dependents) {
+                       if (si->num_dependents > 0) {
                                /*This is an unassigned SI with dependents but 
no sponsors.
                                  Take action on dependents.*/
-                               sidep_take_action_on_dependents(si);
+                               si->take_action_on_dependents();
                        }
                        break;
                default:

------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to