ack, code review only, but remove void from members with empty
parameters./Regards HansN
On 04/30/14 07:01, Hans Feldt wrote:
> osaf/services/saf/amf/amfd/include/su.h | 8 +++---
> osaf/services/saf/amf/amfd/siass.cc | 29 ++++++++++++---------
> osaf/services/saf/amf/amfd/su.cc | 44
> ++++++++++++++++----------------
> 3 files changed, 42 insertions(+), 39 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,10 @@ class AVD_SU {
> struct avd_sutype *su_type;
> AVD_SU *su_list_su_type_next;
>
> + void dec_curr_stdby_si(void);
> + void inc_curr_stdby_si(void);
> + void inc_curr_act_si(void);
> + void dec_curr_act_si(void);
> int hastate_assignments_count(SaAmfHAStateT ha_state);
> void add_comp(struct avd_comp_tag *comp);
> void remove_comp(struct avd_comp_tag *comp);
> @@ -189,10 +193,6 @@ extern SaAisErrorT avd_sutcomptype_confi
> */
> extern void avd_sutcomptype_constructor(void);
>
> -extern void avd_su_inc_curr_act_si(AVD_SU *su);
> -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 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/siass.cc
> b/osaf/services/saf/amf/amfd/siass.cc
> --- a/osaf/services/saf/amf/amfd/siass.cc
> +++ b/osaf/services/saf/amf/amfd/siass.cc
> @@ -350,6 +350,7 @@ AVD_SU_SI_REL *avd_susi_find(AVD_CL_CB *
> uint32_t avd_susi_delete(AVD_CL_CB *cb, AVD_SU_SI_REL *susi, bool ckpt)
> {
> AVD_SU_SI_REL *p_su_si, *p_si_su, *i_su_si;
> + AVD_SU *su = susi->su;
>
> TRACE_ENTER2("%s %s", susi->su->name.value, susi->si->name.value);
>
> @@ -406,10 +407,10 @@ uint32_t avd_susi_delete(AVD_CL_CB *cb,
> only happens when active -> qsd and standby rebooted
> */
> } else if ((susi->fsm == AVD_SU_SI_STATE_ASGND) || (susi->fsm
> == AVD_SU_SI_STATE_ASGN)){
> if (SA_AMF_HA_STANDBY == susi->state) {
> - avd_su_dec_curr_stdby_si(susi->su);
> + su->dec_curr_stdby_si();
> avd_si_dec_curr_stdby_ass(susi->si);
> } else if ((SA_AMF_HA_ACTIVE == susi->state) ||
> (SA_AMF_HA_QUIESCING == susi->state)) {
> - avd_su_dec_curr_act_si(susi->su);
> + su->dec_curr_act_si();
> avd_si_dec_curr_act_ass(susi->si);
> }
> }
> @@ -596,52 +597,54 @@ done:
> */
> void avd_susi_update_assignment_counters(AVD_SU_SI_REL *susi, AVSV_SUSI_ACT
> action, SaAmfHAStateT current_ha_state, SaAmfHAStateT new_ha_state)
> {
> + AVD_SU *su = susi->su;
> +
> TRACE_ENTER2("SI:'%s', SU:'%s' action:%u current_ha_state:%u
> new_ha_state:%u",
> susi->si->name.value, susi->su->name.value, action,
> current_ha_state, new_ha_state);
>
> switch (action) {
> case AVSV_SUSI_ACT_ASGN:
> if (new_ha_state == SA_AMF_HA_ACTIVE) {
> - avd_su_inc_curr_act_si(susi->su);
> + su->inc_curr_act_si();
> avd_si_inc_curr_act_ass(susi->si);
> } else if (new_ha_state == SA_AMF_HA_STANDBY) {
> - avd_su_inc_curr_stdby_si(susi->su);
> + su->inc_curr_stdby_si();
> avd_si_inc_curr_stdby_ass(susi->si);
> }
> break;
> case AVSV_SUSI_ACT_MOD:
> if ((current_ha_state == SA_AMF_HA_STANDBY) && (new_ha_state ==
> SA_AMF_HA_ACTIVE)) {
> /* standby to active */
> - avd_su_inc_curr_act_si(susi->su);
> - avd_su_dec_curr_stdby_si(susi->su);
> + su->inc_curr_act_si();
> + su->dec_curr_stdby_si();
> avd_si_inc_curr_act_dec_std_ass(susi->si);
> } else if (((current_ha_state == SA_AMF_HA_ACTIVE) ||
> (current_ha_state == SA_AMF_HA_QUIESCING))
> && (new_ha_state == SA_AMF_HA_QUIESCED)) {
> /* active or quiescing to quiesced */
> - avd_su_dec_curr_act_si(susi->su);
> + su->dec_curr_act_si();
> avd_si_dec_curr_act_ass(susi->si);
> } else if ((current_ha_state == SA_AMF_HA_QUIESCED) &&
> (new_ha_state == SA_AMF_HA_STANDBY)) {
> /* active or quiescinf to standby */
> - avd_su_inc_curr_stdby_si(susi->su);
> + su->inc_curr_stdby_si();
> avd_si_inc_curr_stdby_ass(susi->si);
> } else if (((current_ha_state == SA_AMF_HA_ACTIVE) ||
> (current_ha_state == SA_AMF_HA_QUIESCING))
> && (new_ha_state == SA_AMF_HA_STANDBY)) {
> /* active or quiescinf to standby */
> - avd_su_dec_curr_act_si(susi->su);
> - avd_su_inc_curr_stdby_si(susi->su);
> + su->dec_curr_act_si();
> + su->inc_curr_stdby_si();
> avd_si_inc_curr_stdby_dec_act_ass(susi->si);
> } else if ((current_ha_state == SA_AMF_HA_QUIESCED) &&
> (new_ha_state == SA_AMF_HA_ACTIVE)) {
> /* quiescing to active */
> - avd_su_inc_curr_act_si(susi->su);
> + su->inc_curr_act_si();
> avd_si_inc_curr_act_ass(susi->si);
> }
> break;
> case AVSV_SUSI_ACT_DEL:
> if (susi->state == SA_AMF_HA_STANDBY) {
> - avd_su_dec_curr_stdby_si(susi->su);
> + su->dec_curr_stdby_si();
> avd_si_dec_curr_stdby_ass(susi->si);
> } else if ((susi->state == SA_AMF_HA_ACTIVE) || (susi->state ==
> SA_AMF_HA_QUIESCING)) {
> - avd_su_dec_curr_act_si(susi->su);
> + su->dec_curr_act_si();
> avd_si_dec_curr_act_ass(susi->si);
> }
> break;
> 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
> @@ -1559,34 +1559,34 @@ static void su_ccb_apply_cb(CcbUtilOpera
> TRACE_LEAVE();
> }
>
> -void avd_su_inc_curr_act_si(AVD_SU *su)
> -{
> - su->saAmfSUNumCurrActiveSIs++;
> - TRACE("%s saAmfSUNumCurrActiveSIs=%u", su->name.value,
> su->saAmfSUNumCurrActiveSIs);
> - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, su,
> AVSV_CKPT_SU_SI_CURR_ACTIVE);
> +void AVD_SU::inc_curr_act_si(void) {
> + saAmfSUNumCurrActiveSIs++;
> + TRACE("%s saAmfSUNumCurrActiveSIs=%u", name.value,
> + saAmfSUNumCurrActiveSIs);
> + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this,
> AVSV_CKPT_SU_SI_CURR_ACTIVE);
> }
>
> -void avd_su_dec_curr_act_si(AVD_SU *su)
> -{
> - osafassert(su->saAmfSUNumCurrActiveSIs > 0);
> - su->saAmfSUNumCurrActiveSIs--;
> - TRACE("%s saAmfSUNumCurrActiveSIs=%u", su->name.value,
> su->saAmfSUNumCurrActiveSIs);
> - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, su,
> AVSV_CKPT_SU_SI_CURR_ACTIVE);
> +void AVD_SU::dec_curr_act_si(void) {
> + osafassert(saAmfSUNumCurrActiveSIs > 0);
> + saAmfSUNumCurrActiveSIs--;
> + TRACE("%s saAmfSUNumCurrActiveSIs=%u", name.value,
> + saAmfSUNumCurrActiveSIs);
> + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this,
> AVSV_CKPT_SU_SI_CURR_ACTIVE);
> }
>
> -void avd_su_inc_curr_stdby_si(AVD_SU *su)
> -{
> - su->saAmfSUNumCurrStandbySIs++;
> - TRACE("%s saAmfSUNumCurrStandbySIs=%u", su->name.value,
> su->saAmfSUNumCurrStandbySIs);
> - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, su, AVSV_CKPT_SU_SI_CURR_STBY);
> +void AVD_SU::inc_curr_stdby_si(void) {
> + saAmfSUNumCurrStandbySIs++;
> + TRACE("%s saAmfSUNumCurrStandbySIs=%u", name.value,
> + saAmfSUNumCurrStandbySIs);
> + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this,
> AVSV_CKPT_SU_SI_CURR_STBY);
> }
>
> -void avd_su_dec_curr_stdby_si(AVD_SU *su)
> -{
> - osafassert(su->saAmfSUNumCurrStandbySIs > 0);
> - su->saAmfSUNumCurrStandbySIs--;
> - TRACE("%s saAmfSUNumCurrStandbySIs=%u", su->name.value,
> su->saAmfSUNumCurrStandbySIs);
> - m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, su, AVSV_CKPT_SU_SI_CURR_STBY);
> +void AVD_SU::dec_curr_stdby_si(void) {
> + osafassert(saAmfSUNumCurrStandbySIs > 0);
> + saAmfSUNumCurrStandbySIs--;
> + TRACE("%s saAmfSUNumCurrStandbySIs=%u", name.value,
> + saAmfSUNumCurrStandbySIs);
> + m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this,
> AVSV_CKPT_SU_SI_CURR_STBY);
> }
>
> void avd_su_constructor(void)
------------------------------------------------------------------------------
"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
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel