Ack for all the series of patches with one comment on this one:

Suggested name of +int AVD_SU::no_assignments_of_hastate(SaAmfHAStateT 
ha_state) {
To 
+int AVD_SU:: hastate_assignments_count(SaAmfHAStateT ha_state) {

Thanks
-Nagu

> -----Original Message-----
> From: Hans Feldt [mailto:osafde...@gmail.com]
> Sent: 22 April 2014 16:28
> To: Praveen Malviya; Nagendra Kumar; hans.nordeb...@ericsson.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 5 of 5] amfd: add and use SU method
> no_assignments_of_hastate [#713]
> 
>  osaf/services/saf/amf/amfd/include/su.h   |   2 +-
>  osaf/services/saf/amf/amfd/sg_nway_fsm.cc |   2 +-
>  osaf/services/saf/amf/amfd/su.cc          |  12 +++++-------
>  3 files changed, 7 insertions(+), 9 deletions(-)
> 
> 
> diff --git a/osaf/services/saf/amf/amfd/include/su.h
> b/osaf/services/saf/amf/amfd/include/su.h
> --- a/osaf/services/saf/amf/amfd/include/su.h
> +++ b/osaf/services/saf/amf/amfd/include/su.h
> @@ -91,6 +91,7 @@ class AVD_SU {
>       struct avd_sutype *su_type;
>       AVD_SU *su_list_su_type_next;
> 
> +     int no_assignments_of_hastate(SaAmfHAStateT ha_state);
>       void add_comp(struct avd_comp_tag *comp);
>       void remove_comp(struct avd_comp_tag *comp);
>       void set_admin_state(SaAmfAdminStateT admin_state);
> @@ -192,7 +193,6 @@ extern void avd_su_inc_curr_act_si(AVD_S
>  extern void avd_su_dec_curr_act_si(AVD_SU *su);
>  extern void avd_su_inc_curr_stdby_si(AVD_SU *su);
>  extern void avd_su_dec_curr_stdby_si(AVD_SU *su);
> -extern uint32_t avd_su_get_current_no_of_assignments(AVD_SU *su,
> SaAmfHAStateT ha_state);
>  extern AVD_SU *avd_su_get_or_create(const SaNameT *dn);
>  extern void su_nd_attribute_update(const AVD_SU *su,
> AVSV_AMF_SU_ATTR_ID attrib_id);
> 
> 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
> @@ -1321,7 +1321,7 @@ AVD_SU *avd_sg_nway_get_su_std_equal(AVD
>               l_flag = true;
> 
>               /* Get the current no of Standby assignments on the su */
> -             curr_su_stdby_cnt =
> avd_su_get_current_no_of_assignments(curr_su, SA_AMF_HA_STANDBY);
> +             curr_su_stdby_cnt = curr_su-
> >no_assignments_of_hastate(SA_AMF_HA_STANDBY);
> 
>               /* first try to select an SU which has no assignments */
>               if ((curr_su->saAmfSuReadinessState ==
> SA_AMF_READINESS_IN_SERVICE) &&
> diff --git a/osaf/services/saf/amf/amfd/su.cc
> b/osaf/services/saf/amf/amfd/su.cc
> --- a/osaf/services/saf/amf/amfd/su.cc
> +++ b/osaf/services/saf/amf/amfd/su.cc
> @@ -105,18 +105,16 @@ AVD_SU *avd_su_get_or_create(const SaNam
>  /**
>   * @brief   gets the current no of assignmnents on a SU for a particular 
> state
>   *
> - * @param[in] su
>   * @param[in] ha_state
>   *
>   * @return returns current assignment cnt
>   */
> -uint32_t avd_su_get_current_no_of_assignments(AVD_SU *su,
> SaAmfHAStateT ha_state)
> -{
> -     AVD_SU_SI_REL *curr_susi;
> -     uint32_t curr_assignment_cnt = 0;
> +int AVD_SU::no_assignments_of_hastate(SaAmfHAStateT ha_state) {
> +     const AVD_SU_SI_REL *susi;
> +     int curr_assignment_cnt = 0;
> 
> -     for (curr_susi = su->list_of_susi;curr_susi != NULL;curr_susi = 
> curr_susi-
> >su_next) {
> -             if (curr_susi->state == ha_state)
> +     for (susi = list_of_susi; susi != NULL; susi = susi->su_next) {
> +             if (susi->state == ha_state)
>                       curr_assignment_cnt++;
>       }
> 

------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to