ack/Regards HansN
On 06/13/14 07:48, Gary Lee wrote:
>   osaf/services/saf/amf/amfd/include/si.h      |  10 +++++-----
>   osaf/services/saf/amf/amfd/sg_nway_fsm.cc    |  10 +++++-----
>   osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc |  10 +++++-----
>   osaf/services/saf/amf/amfd/si.cc             |  20 ++++++++++++++++++++
>   4 files changed, 35 insertions(+), 15 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
> @@ -122,6 +122,11 @@ public:
>       void remove_rankedsu(const SaNameT *suname);
>       
>       void set_si_switch(AVD_CL_CB *cb, const SaToggleState state);
> +     
> +     uint32_t active_pref_assignments() const;
> +     uint32_t active_curr_assignments() const;
> +     uint32_t standby_pref_assignments() const;
> +     uint32_t standby_curr_assignments() const;
>   
>   private:
>       AVD_SI(const AVD_SI&);
> @@ -130,11 +135,6 @@ private:
>   
>   extern AmfDb<std::string, AVD_SI> *si_db;
>   #define AVD_SI_NULL ((AVD_SI *)0)
> -#define m_AVD_SI_ACTV_MAX_SU(l_si) (l_si)->saAmfSIPrefActiveAssignments
> -#define m_AVD_SI_ACTV_CURR_SU(l_si) (l_si)->saAmfSINumCurrActiveAssignments
> -
> -#define m_AVD_SI_STDBY_MAX_SU(l_si)       
> (l_si)->saAmfSIPrefStandbyAssignments
> -#define m_AVD_SI_STDBY_CURR_SU(l_si)      
> (l_si)->saAmfSINumCurrStandbyAssignments
>   
>   extern void avd_si_add_csi(struct avd_csi_tag* csi);
>   extern void avd_si_remove_csi(struct avd_csi_tag *csi);
> diff --git a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc 
> b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
> --- a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
> +++ b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
> @@ -1596,7 +1596,7 @@ uint32_t avd_sg_nway_si_assign(AVD_CL_CB
>                       continue;
>   
>               /* verify if si needs more assigments */
> -             if (m_AVD_SI_STDBY_CURR_SU(curr_si) == 
> m_AVD_SI_STDBY_MAX_SU(curr_si))
> +             if (curr_si->standby_curr_assignments() == 
> curr_si->standby_pref_assignments())
>                       continue;
>   
>               /* we've a not-so-fully-assigned si.. find sus for standby 
> assignment */
> @@ -1626,7 +1626,7 @@ uint32_t avd_sg_nway_si_assign(AVD_CL_CB
>                               m_AVD_SET_SG_FSM(cb, sg, AVD_SG_FSM_SG_REALIGN);
>   
>                               /* verify if si needs more assigments */
> -                             if (m_AVD_SI_STDBY_CURR_SU(curr_si) == 
> m_AVD_SI_STDBY_MAX_SU(curr_si))
> +                             if (curr_si->standby_curr_assignments() == 
> curr_si->standby_pref_assignments())
>                                       break;
>                       } else {
>                               LOG_ER("%s:%u: %s (%u)", __FILE__, __LINE__, 
> curr_si->name.value, curr_si->name.length);
> @@ -1634,7 +1634,7 @@ uint32_t avd_sg_nway_si_assign(AVD_CL_CB
>               }
>   
>               /* verify if si needs more assigments */
> -             if (m_AVD_SI_STDBY_CURR_SU(curr_si) == 
> m_AVD_SI_STDBY_MAX_SU(curr_si))
> +             if (curr_si->standby_curr_assignments() == 
> curr_si->standby_pref_assignments())
>                       continue;
>   
>               if (sg->equal_ranked_su == true) {
> @@ -1654,7 +1654,7 @@ uint32_t avd_sg_nway_si_assign(AVD_CL_CB
>                                       m_AVD_SET_SG_FSM(cb, sg, 
> AVD_SG_FSM_SG_REALIGN);
>   
>                                       /* verify if si needs more assigments */
> -                                     if (m_AVD_SI_STDBY_CURR_SU(curr_si) == 
> m_AVD_SI_STDBY_MAX_SU(curr_si))
> +                                     if (curr_si->standby_curr_assignments() 
> == curr_si->standby_pref_assignments())
>                                               break;
>                               } else {
>                                       LOG_ER("%s:%u: %s (%u)", __FILE__, 
> __LINE__, curr_si->name.value, curr_si->name.length);
> @@ -1691,7 +1691,7 @@ uint32_t avd_sg_nway_si_assign(AVD_CL_CB
>                               m_AVD_SET_SG_FSM(cb, sg, AVD_SG_FSM_SG_REALIGN);
>   
>                               /* verify if si needs more assigments */
> -                             if (m_AVD_SI_STDBY_CURR_SU(curr_si) == 
> m_AVD_SI_STDBY_MAX_SU(curr_si))
> +                             if (curr_si->standby_curr_assignments() == 
> curr_si->standby_pref_assignments())
>                                       break;
>                       } else {
>                               LOG_ER("%s:%u: %s (%u)", __FILE__, __LINE__, 
> curr_si->name.value, curr_si->name.length);
> diff --git a/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc 
> b/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc
> --- a/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc
> +++ b/osaf/services/saf/amf/amfd/sg_nwayact_fsm.cc
> @@ -72,7 +72,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
>               /* verify that the SI is ready and needs come more assignments. 
> */
>               if ((i_si->saAmfSIAdminState != SA_AMF_ADMIN_UNLOCKED) ||
>                       (i_si->list_of_csi == NULL) ||
> -                 (m_AVD_SI_ACTV_MAX_SU(i_si) <= 
> m_AVD_SI_ACTV_CURR_SU(i_si))) {
> +                 (i_si->active_pref_assignments() <= 
> i_si->active_curr_assignments() )) {
>                       i_si = i_si->sg_list_of_si_next;
>                       continue;
>               }
> @@ -120,7 +120,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
>   
>                               /* Check if the SI can take more assignments. 
> If not exit the SU loop.
>                                */
> -                             if (m_AVD_SI_ACTV_MAX_SU(i_si) <= 
> m_AVD_SI_ACTV_CURR_SU(i_si)) {
> +                             if (i_si->active_pref_assignments() <= 
> i_si->active_curr_assignments() ) {
>                                       break;
>                               }
>                       } else {
> @@ -147,7 +147,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
>   
>                       l_flag = true;
>   
> -                     if (m_AVD_SI_ACTV_MAX_SU(i_si) <= 
> m_AVD_SI_ACTV_CURR_SU(i_si)) {
> +                     if (i_si->active_pref_assignments() <= 
> i_si->active_curr_assignments() ) {
>                               /* The preferred number of active assignments 
> for SI has reached, so continue
>                                  to next SI */
>                               i_su = NULL;
> @@ -170,7 +170,7 @@ AVD_SU *avd_sg_nacvred_su_chose_asgn(AVD
>   
>                               /* Check if the SI can take more assignments. 
> If not exit the SU loop.
>                                */
> -                             if (m_AVD_SI_ACTV_MAX_SU(i_si) <= 
> m_AVD_SI_ACTV_CURR_SU(i_si)) {
> +                             if (i_si->active_pref_assignments() <= 
> i_si->active_curr_assignments() ) {
>                                       i_su = NULL;
>                                       continue;
>                               }
> @@ -1982,7 +1982,7 @@ static AVD_SU *avd_get_qualified_su(AVD_
>       AVD_SU *i_su, *pref_su = NULL, *pre_temp_su = NULL;
>       bool l_flag = false, l_flag_1 = false;
>       TRACE_ENTER();
> -     if (m_AVD_SI_ACTV_MAX_SU(i_si) <= m_AVD_SI_ACTV_CURR_SU(i_si)) {
> +     if (i_si->active_pref_assignments() <= i_si->active_curr_assignments() 
> ) {
>               /* The preferred number of active assignments for SI has 
> reached, so return
>                  and try assigning next SI*/
>               *next_si_tobe_assigned = true;
> diff --git a/osaf/services/saf/amf/amfd/si.cc 
> b/osaf/services/saf/amf/amfd/si.cc
> --- a/osaf/services/saf/amf/amfd/si.cc
> +++ b/osaf/services/saf/amf/amfd/si.cc
> @@ -1367,3 +1367,23 @@ void AVD_SI::set_si_switch(AVD_CL_CB *cb
>       si_switch = state;
>       m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(cb, this, AVSV_CKPT_SI_SWITCH);
>   }
> +
> +uint32_t AVD_SI::active_pref_assignments() const
> +{
> +     return saAmfSIPrefActiveAssignments;
> +}
> +
> +uint32_t AVD_SI::active_curr_assignments() const
> +{
> +     return saAmfSINumCurrActiveAssignments;
> +}
> +
> +uint32_t AVD_SI::standby_pref_assignments() const
> +{
> +     return saAmfSIPrefStandbyAssignments;
> +}
> +
> +uint32_t AVD_SI::standby_curr_assignments() const
> +{
> +     return saAmfSINumCurrStandbyAssignments;
> +}


------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to