Ack.

Thanks
-Nagu

-----Original Message-----
From: Hans Feldt [mailto:osafde...@gmail.com] 
Sent: 01 October 2013 20:28
To: Nagendra Kumar
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] amfnd: remove destroy functionality [#534]

 osaf/services/saf/amf/amfnd/clm.cc               |   20 -
 osaf/services/saf/amf/amfnd/compdb.cc            |   44 ----
 osaf/services/saf/amf/amfnd/di.cc                |   30 --
 osaf/services/saf/amf/amfnd/hcdb.cc              |   40 ---
 osaf/services/saf/amf/amfnd/include/avnd_cb.h    |    6 -
 osaf/services/saf/amf/amfnd/include/avnd_clm.h   |    1 -
 osaf/services/saf/amf/amfnd/include/avnd_comp.h  |    8 -
 osaf/services/saf/amf/amfnd/include/avnd_hc.h    |    1 -
 osaf/services/saf/amf/amfnd/include/avnd_mds.h   |    2 -
 osaf/services/saf/amf/amfnd/include/avnd_mon.h   |    1 -
 osaf/services/saf/amf/amfnd/include/avnd_pg.h    |    1 -
 osaf/services/saf/amf/amfnd/include/avnd_proc.h  |    1 -
 osaf/services/saf/amf/amfnd/include/avnd_proxy.h |    2 -
 osaf/services/saf/amf/amfnd/include/avnd_su.h    |    1 -
 osaf/services/saf/amf/amfnd/main.cc              |  236 -----------------------
 osaf/services/saf/amf/amfnd/mds.cc               |   34 ---
 osaf/services/saf/amf/amfnd/mon.cc               |   31 ---
 osaf/services/saf/amf/amfnd/pgdb.cc              |   37 ---
 osaf/services/saf/amf/amfnd/proxydb.cc           |   78 -------
 osaf/services/saf/amf/amfnd/sudb.cc              |   42 ----
 20 files changed, 0 insertions(+), 616 deletions(-)


diff --git a/osaf/services/saf/amf/amfnd/clm.cc 
b/osaf/services/saf/amf/amfnd/clm.cc
--- a/osaf/services/saf/amf/amfnd/clm.cc
+++ b/osaf/services/saf/amf/amfnd/clm.cc
@@ -286,23 +286,3 @@ done:
        TRACE_LEAVE();
         return error;
 }
-
-SaAisErrorT avnd_clm_stop(void)
-{
-        SaAisErrorT error = SA_AIS_OK;
-       TRACE_ENTER();
-       error = saClmClusterTrackStop(avnd_cb->clmHandle);
-        if (SA_AIS_OK != error) {
-                LOG_ER("Failed to stop cluster tracking %u", error);
-                goto done;
-        }
-       error = saClmFinalize(avnd_cb->clmHandle);
-        if (SA_AIS_OK != error) {
-                LOG_ER("Failed to finalize with CLM %u", error);
-                goto done;
-        }
-done:
-       TRACE_LEAVE();
-        return error;
-}
-
diff --git a/osaf/services/saf/amf/amfnd/compdb.cc 
b/osaf/services/saf/amf/amfnd/compdb.cc
--- a/osaf/services/saf/amf/amfnd/compdb.cc
+++ b/osaf/services/saf/amf/amfnd/compdb.cc
@@ -201,50 +201,6 @@ done:
 }
 
 /****************************************************************************
-  Name          : avnd_compdb_destroy
- 
-  Description   : This routine destroys the component database. It deletes 
-                  all the component records in the database.
- 
-  Arguments     : cb  - ptr to the AvND control block
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None.
-******************************************************************************/
-uint32_t avnd_compdb_destroy(AVND_CB *cb) -{
-       AVND_COMP *comp = 0;
-       uint32_t rc = NCSCC_RC_SUCCESS;
-       TRACE_ENTER();
-
-       /* scan & delete each comp */
-       while (0 != (comp = (AVND_COMP *)ncs_patricia_tree_getnext(&cb->compdb, 
(uint8_t *)0))) {
-               /* delete the record 
-                  m_AVND_SEND_CKPT_UPDT_ASYNC_RMV(cb, comp, 
AVND_CKPT_COMP_CONFIG);
-                  AvND is going down, but don't send any async update even for 
-                  external components, otherwise external components will be 
deleted
-                  from ACT. */
-               rc = avnd_compdb_rec_del(cb, &comp->name);
-               if (NCSCC_RC_SUCCESS != rc)
-                       goto err;
-       }
-
-       /* finally destroy patricia tree */
-       rc = ncs_patricia_tree_destroy(&cb->compdb);
-       if (NCSCC_RC_SUCCESS != rc)
-               goto err;
-
-       TRACE_LEAVE2("Component DB destroy success");
-       return rc;
-
- err:
-       LOG_CR("Component DB destroy failed");
-       TRACE_LEAVE();
-       return rc;
-}
-
-/****************************************************************************
   Name          : avnd_compdb_rec_add
  
   Description   : This routine adds a component record to the component 
diff --git a/osaf/services/saf/amf/amfnd/di.cc 
b/osaf/services/saf/amf/amfnd/di.cc
--- a/osaf/services/saf/amf/amfnd/di.cc
+++ b/osaf/services/saf/amf/amfnd/di.cc
@@ -1027,36 +1027,6 @@ uint32_t avnd_diq_rec_send(AVND_CB *cb, 
        return rc;
 }
 
-/****************************************************************************
-  Name          : avnd_dnd_list_destroy
- 
-  Description   : This routine clean the dnd list in the cb
- 
-  Arguments     : cb  - ptr to the AvND control block
-
-  Return Values : None.
- 
-  Notes         : None.
-******************************************************************************/
-void avnd_dnd_list_destroy(AVND_CB *cb) -{
-       AVND_DND_LIST *list = &((cb)->dnd_list);
-       AVND_DND_MSG_LIST *rec = 0;
-
-       if (list)
-               rec = list->head;
-
-       while (rec) {
-               /* find & pop the matching record */
-               m_AVND_DIQ_REC_FIND_POP(cb, rec);
-               avnd_diq_rec_del(cb, rec);
-
-               rec = list->head;
-       }
-
-       return;
-}
-
 /**
  * Dispatch admin operation requests to the real handler
  * @param cb
diff --git a/osaf/services/saf/amf/amfnd/hcdb.cc 
b/osaf/services/saf/amf/amfnd/hcdb.cc
--- a/osaf/services/saf/amf/amfnd/hcdb.cc
+++ b/osaf/services/saf/amf/amfnd/hcdb.cc
@@ -64,46 +64,6 @@ void avnd_hcdb_init(AVND_CB *cb)
        osafassert(rc == NCSCC_RC_SUCCESS);
 }
 
-/****************************************************************************
-  Name          : avnd_hcdb_destroy
- 
-  Description   : This routine destroys the healthcheck database. It deletes 
-                  all the healthcheck records in the database.
- 
-  Arguments     : cb  - ptr to the AvND control block
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None.
-******************************************************************************/
-uint32_t avnd_hcdb_destroy(AVND_CB *cb) -{
-       AVND_HC *hc = 0;
-       uint32_t rc = NCSCC_RC_SUCCESS;
-
-       /* scan & delete each healthcheck record */
-       while (0 != (hc = (AVND_HC *)ncs_patricia_tree_getnext(&cb->hcdb, 
(uint8_t *)0))) {
-               /*AvND is going down, but don't send any async update even for 
-                  external components, otherwise external components will be 
deleted
-                  from ACT. */
-               rc = avnd_hcdb_rec_del(cb, &hc->key);
-               if (NCSCC_RC_SUCCESS != rc)
-                       goto err;
-       }
-
-       /* finally destroy patricia tree */
-       rc = ncs_patricia_tree_destroy(&cb->hcdb);
-       if (NCSCC_RC_SUCCESS != rc)
-               goto err;
-
-       TRACE("HC DB destroy success");
-       return rc;
-
- err:
-       LOG_ER("HC DB destroy failed");
-       return rc;
-}
-
 AVND_HC *avnd_hcdb_rec_get(AVND_CB *cb, AVSV_HLT_KEY *hc_key)  {
        SaNameT dn;
diff --git a/osaf/services/saf/amf/amfnd/include/avnd_cb.h 
b/osaf/services/saf/amf/amfnd/include/avnd_cb.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_cb.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_cb.h
@@ -155,10 +155,4 @@ typedef struct avnd_cb_tag {
 
 extern AVND_CB *avnd_cb;
 
-extern AVND_CB *avnd_cb;
-
-void avnd_dnd_list_destroy(AVND_CB *);
-
-uint32_t avnd_cb_destroy(AVND_CB *);
-
 #endif
diff --git a/osaf/services/saf/amf/amfnd/include/avnd_clm.h 
b/osaf/services/saf/amf/amfnd/include/avnd_clm.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_clm.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_clm.h
@@ -34,6 +34,5 @@
 struct avnd_cb_tag;
 
 extern SaAisErrorT avnd_clm_init(void); -extern SaAisErrorT 
avnd_clm_stop(void);
 
 #endif
diff --git a/osaf/services/saf/amf/amfnd/include/avnd_comp.h 
b/osaf/services/saf/amf/amfnd/include/avnd_comp.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_comp.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_comp.h
@@ -804,7 +804,6 @@ extern void avnd_comp_cbq_rec_del(struct  extern uint32_t 
avnd_comp_cbq_rec_send(struct avnd_cb_tag *, AVND_COMP *, AVND_COMP_CBK *, 
bool);
 
 extern uint32_t avnd_compdb_init(struct avnd_cb_tag *); -extern uint32_t 
avnd_compdb_destroy(struct avnd_cb_tag *);  extern AVND_COMP 
*avnd_compdb_rec_add(struct avnd_cb_tag *, AVND_COMP_PARAM *, uint32_t *);  
extern uint32_t avnd_compdb_rec_del(struct avnd_cb_tag *, SaNameT *);  extern 
AVND_COMP_CSI_REC *avnd_compdb_csi_rec_get(struct avnd_cb_tag *, SaNameT *, 
SaNameT *); @@ -833,13 +832,6 @@ extern uint32_t avnd_comp_curr_info_del(
 
 extern uint32_t avnd_comp_clc_cmd_execute(struct avnd_cb_tag *, AVND_COMP *, 
AVND_COMP_CLC_CMD_TYPE);
 
-extern uint32_t avnd_srm_req_list_init(struct avnd_cb_tag *); -extern uint32_t 
avnd_srm_req_list_destroy(struct avnd_cb_tag *); -extern struct 
avnd_srm_req_tag *avnd_srm_req_add(struct avnd_cb_tag *, uint32_t, struct 
avnd_pm_rec *); -extern uint32_t avnd_srm_req_del(struct avnd_cb_tag *, 
uint32_t); -extern struct avnd_srm_req_tag *avnd_srm_req_get(struct avnd_cb_tag 
*, uint32_t); -extern uint32_t avnd_srm_req_free(NCS_DB_LINK_LIST_NODE *);
-
 extern void avnd_pm_list_init(AVND_COMP *);  extern uint32_t 
avnd_pm_rec_free(NCS_DB_LINK_LIST_NODE *);  extern uint32_t 
avnd_comp_pm_rec_add(struct avnd_cb_tag *, AVND_COMP *, AVND_COMP_PM_REC *); 
diff --git a/osaf/services/saf/amf/amfnd/include/avnd_hc.h 
b/osaf/services/saf/amf/amfnd/include/avnd_hc.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_hc.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_hc.h
@@ -53,7 +53,6 @@ typedef struct avnd_hctype_tag {
 /* Extern function declarations */
 extern AVND_HC *avnd_hcdb_rec_get(struct avnd_cb_tag *cb, AVSV_HLT_KEY 
*hc_key);  extern void avnd_hcdb_init(struct avnd_cb_tag *); -extern uint32_t 
avnd_hcdb_destroy(struct avnd_cb_tag *);  extern AVND_HC 
*avnd_hcdb_rec_add(struct avnd_cb_tag *, AVND_HC_PARAM *, uint32_t *);  extern 
uint32_t avnd_hcdb_rec_del(struct avnd_cb_tag *, AVSV_HLT_KEY *);  extern 
SaAisErrorT avnd_hc_config_get(struct avnd_comp_tag *comp); diff --git 
a/osaf/services/saf/amf/amfnd/include/avnd_mds.h 
b/osaf/services/saf/amf/amfnd/include/avnd_mds.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_mds.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_mds.h
@@ -128,8 +128,6 @@ struct avnd_cb_tag;
 
 uint32_t avnd_mds_reg(struct avnd_cb_tag *);
 
-uint32_t avnd_mds_unreg(struct avnd_cb_tag *);
-
 uint32_t avnd_mds_cbk(NCSMDS_CALLBACK_INFO *info);
 
 uint32_t avnd_mds_send(struct avnd_cb_tag *, AVND_MSG *, MDS_DEST *, 
MDS_SYNC_SND_CTXT *); diff --git 
a/osaf/services/saf/amf/amfnd/include/avnd_mon.h 
b/osaf/services/saf/amf/amfnd/include/avnd_mon.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_mon.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_mon.h
@@ -31,7 +31,6 @@
 #define AVND_MON_H
 
 void avnd_pid_mon_list_init(struct avnd_cb_tag *); -void 
avnd_pid_mon_list_destroy(struct avnd_cb_tag *);  void avnd_mon_process(void 
*);  uint32_t avnd_mon_task_create(void);  uint32_t avnd_mon_req_del(struct 
avnd_cb_tag *, SaUint64T); diff --git 
a/osaf/services/saf/amf/amfnd/include/avnd_pg.h 
b/osaf/services/saf/amf/amfnd/include/avnd_pg.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_pg.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_pg.h
@@ -116,7 +116,6 @@ typedef struct avnd_pg {
  ***************************************************************************/
 
 uint32_t avnd_pgdb_init(struct avnd_cb_tag *); -uint32_t 
avnd_pgdb_destroy(struct avnd_cb_tag *);  AVND_PG *avnd_pgdb_rec_add(struct 
avnd_cb_tag *, SaNameT *, uint32_t *);  uint32_t avnd_pgdb_rec_del(struct 
avnd_cb_tag *, SaNameT *);
 
diff --git a/osaf/services/saf/amf/amfnd/include/avnd_proc.h 
b/osaf/services/saf/amf/amfnd/include/avnd_proc.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_proc.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_proc.h
@@ -109,7 +109,6 @@ uint32_t avnd_evt_last_step_term_evh(str  void 
avnd_last_step_clean(struct avnd_cb_tag *cb);
 
 uint32_t avnd_evt_avd_set_leds_evh(struct avnd_cb_tag *, struct avnd_evt_tag 
*); -uint32_t avnd_destroy(void);  uint32_t avnd_evt_avnd_avnd_evh(struct 
avnd_cb_tag *, struct avnd_evt_tag *);  uint32_t 
avnd_evt_ha_state_change_evh(struct avnd_cb_tag *, struct avnd_evt_tag *);  
uint32_t avnd_evt_comp_admin_op_req (struct avnd_cb_tag *, struct avnd_evt_tag 
*); diff --git a/osaf/services/saf/amf/amfnd/include/avnd_proxy.h 
b/osaf/services/saf/amf/amfnd/include/avnd_proxy.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_proxy.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_proxy.h
@@ -46,8 +46,6 @@ uint32_t avnd_nodeid_mdsdest_rec_add(AVN  uint32_t 
avnd_nodeid_mdsdest_rec_del(AVND_CB *cb, MDS_DEST mds_dest);  uint32_t 
avnd_nodeid_to_mdsdest_map_db_init(AVND_CB *cb);  uint32_t 
avnd_internode_avail_comp_db_init(AVND_CB *cb); -uint32_t 
avnd_nodeid_to_mdsdest_map_db_destroy(AVND_CB *cb); -uint32_t 
avnd_internode_avail_comp_db_destroy(AVND_CB *cb);  uint32_t 
avnd_int_ext_comp_hdlr(AVND_CB *cb, AVSV_AMF_API_INFO *api_info,
                             MDS_SYNC_SND_CTXT *ctxt, SaAisErrorT *o_amf_rc, 
bool *int_ext_comp);  uint32_t avnd_avnd_msg_send(AVND_CB *cb, uint8_t 
*msg_info, AVSV_AMF_API_TYPE type, MDS_SYNC_SND_CTXT *ctxt, NODE_ID node_id); 
diff --git a/osaf/services/saf/amf/amfnd/include/avnd_su.h 
b/osaf/services/saf/amf/amfnd/include/avnd_su.h
--- a/osaf/services/saf/amf/amfnd/include/avnd_su.h
+++ b/osaf/services/saf/amf/amfnd/include/avnd_su.h
@@ -362,7 +362,6 @@ struct avnd_cb_tag;
 uint32_t avnd_su_pres_fsm_run(struct avnd_cb_tag *, AVND_SU *, AVND_COMP *, 
AVND_SU_PRES_FSM_EV);
 
 uint32_t avnd_sudb_init(struct avnd_cb_tag *); -uint32_t 
avnd_sudb_destroy(struct avnd_cb_tag *);  AVND_SU *avnd_sudb_rec_add(struct 
avnd_cb_tag *, AVND_SU_PARAM *, uint32_t *);  uint32_t avnd_sudb_rec_del(struct 
avnd_cb_tag *, SaNameT *);
 
diff --git a/osaf/services/saf/amf/amfnd/main.cc 
b/osaf/services/saf/amf/amfnd/main.cc
--- a/osaf/services/saf/amf/amfnd/main.cc
+++ b/osaf/services/saf/amf/amfnd/main.cc
@@ -132,12 +132,6 @@ static uint32_t avnd_mbx_create(AVND_CB 
 
 static uint32_t avnd_ext_intf_create(AVND_CB *);
 
-static uint32_t avnd_mbx_destroy(AVND_CB *);
-
-static uint32_t avnd_ext_intf_destroy(AVND_CB *);
-
-static bool avnd_mbx_clean(NCSCONTEXT, NCSCONTEXT);
-
 
 static int __init_avnd(void)
 {
@@ -267,55 +261,6 @@ uint32_t avnd_create(void)
        }
 
 done:
-       /* if failed, perform the cleanup */
-       if (NCSCC_RC_SUCCESS != rc)
-               avnd_destroy();
-
-       TRACE_LEAVE();
-       return rc;
-}
-
-/****************************************************************************
-  Name          : avnd_destroy
- 
-  Description   : This routine destroys the PWE of AvND. It does the following:
-                  a) destroy external interfaces (logging service being the
-                     exception).
-                  b) detach & destroy AvND mailbox.
-                  c) destroy AvND control block.
-                  d) destroy AvND task.
- 
-  Arguments     : None.
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None.
-******************************************************************************/
-uint32_t avnd_destroy()
-{
-       AVND_CB *cb = avnd_cb;
-       uint32_t rc = NCSCC_RC_SUCCESS;
-       TRACE_ENTER();
-
-        /* stop clm tracking and finalize */
-        avnd_clm_stop();
-
-       /* destroy external interfaces */
-       rc = avnd_ext_intf_destroy(cb);
-       if (NCSCC_RC_SUCCESS != rc)
-               goto done;
-
-       /* destroy AvND control block */
-       rc = avnd_cb_destroy(cb);
-       if (NCSCC_RC_SUCCESS != rc)
-               goto done;
-
-       /* destroy AvND task */
-       /*rc = avnd_task_destroy();
-        *if ( NCSCC_RC_SUCCESS != rc ) goto done;
-        */
-
-done:
        TRACE_LEAVE();
        return rc;
 }
@@ -410,8 +355,6 @@ AVND_CB *avnd_cb_create()
        return cb;
 
  err:
-       if (cb)
-               avnd_cb_destroy(cb);
        TRACE_LEAVE();
        return 0;
 }
@@ -451,9 +394,6 @@ uint32_t avnd_mbx_create(AVND_CB *cb)
        return rc;
 
  err:
-       /* destroy the mailbox */
-       if (cb->mbx)
-               avnd_mbx_destroy(cb);
        TRACE_LEAVE();
        return rc;
 }
@@ -526,187 +466,11 @@ uint32_t avnd_ext_intf_create(AVND_CB *c
        return rc;
 
  err:
-       /* destroy external interfaces */
-       avnd_ext_intf_destroy(cb);
        TRACE_LEAVE();
        return rc;
 }
 
 /****************************************************************************
-  Name          : avnd_cb_destroy
- 
-  Description   : This routine destroys AvND control block.
- 
-  Arguments     : cb - ptr to AvND control block
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None
-******************************************************************************/
-uint32_t avnd_cb_destroy(AVND_CB *cb)
-{
-       uint32_t rc = NCSCC_RC_SUCCESS;
-       TRACE_ENTER();
-
-   /*** destroy all databases ***/
-
-       /* We should delete external SU-SI first */
-#ifdef NCS_AVND_MBCSV_CKPT
-       if (NCSCC_RC_SUCCESS != (rc = avnd_ext_comp_data_clean_up(cb, true)))
-               goto done;
-#endif
-       /* destroy comp db */
-       if (NCSCC_RC_SUCCESS != (rc = avnd_compdb_destroy(cb)))
-               goto done;
-
-       /* destroy su db */
-       if (NCSCC_RC_SUCCESS != (rc = avnd_sudb_destroy(cb)))
-               goto done;
-
-       /* destroy healthcheck db */
-       if (NCSCC_RC_SUCCESS != (rc = avnd_hcdb_destroy(cb)))
-               goto done;
-
-       /* destroy pg db */
-       if (NCSCC_RC_SUCCESS != (rc = avnd_pgdb_destroy(cb)))
-               goto done;
-
-       /* Clean PID monitoring list */
-       avnd_pid_mon_list_destroy(cb);
-
-       /* destroy nodeid to mds dest db */
-       if (NCSCC_RC_SUCCESS != (rc = 
avnd_nodeid_to_mdsdest_map_db_destroy(cb)))
-               goto done;
-
-       /* destroy available internode comp db */
-       if (NCSCC_RC_SUCCESS != (rc = avnd_internode_avail_comp_db_destroy(cb)))
-               goto done;
-
-       /* destroy DND list */
-       avnd_dnd_list_destroy(cb);
-
-       /* destroy the lock */
-       m_NCS_LOCK_DESTROY(&cb->lock);
-       TRACE("Destroyed the cb lock");
-
-       /* destroy the PID monitor lock */
-       m_NCS_LOCK_DESTROY(&cb->mon_lock);
-
-       /* detach & destroy AvND mailbox */
-       rc = avnd_mbx_destroy(cb);
-       if (NCSCC_RC_SUCCESS != rc)
-               goto done;
-
-       cb = NULL;
-       TRACE("finalized the control block");
-
-done:
-       if (NCSCC_RC_SUCCESS != rc)
-               LOG_ER("cleanup failed");
-       TRACE_LEAVE();
-       return rc;
-}
-
-/****************************************************************************
-  Name          : avnd_mbx_destroy
- 
-  Description   : This routine destroys & detaches AvND mailbox.
- 
-  Arguments     : cb - ptr to AvND control block
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None
-******************************************************************************/
-uint32_t avnd_mbx_destroy(AVND_CB *cb)
-{
-       uint32_t rc = NCSCC_RC_SUCCESS;
-       TRACE_ENTER();
-
-       /* detach the mail box */
-       rc = m_NCS_IPC_DETACH(&cb->mbx, avnd_mbx_clean, cb);
-       if (NCSCC_RC_SUCCESS != rc) {
-               LOG_ER("Mailbox detatch failed");
-               goto done;
-       }
-
-       /* delete the mail box */
-       rc = m_NCS_IPC_RELEASE(&cb->mbx, 0);
-       if (NCSCC_RC_SUCCESS != rc) {
-               LOG_ER("Mailbox delete failed");
-               goto done;
-       }
-
- done:
-       TRACE_LEAVE();
-       return rc;
-}
-
-/****************************************************************************
-  Name          : avnd_ext_intf_destroy
- 
-  Description   : This routine destroys external interfaces (logging service
-                  being the exception).
- 
-  Arguments     : cb - ptr to AvND control block
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None
-******************************************************************************/
-uint32_t avnd_ext_intf_destroy(AVND_CB *cb) -{
-       uint32_t rc = NCSCC_RC_SUCCESS;
-       TRACE_ENTER();
-
-       /* MDS unregistration */
-       rc = avnd_mds_unreg(cb);
-       if (NCSCC_RC_SUCCESS != rc)
-               goto done;
-
-       /* EDU cleanup */
-       m_NCS_EDU_HDL_FLUSH(&cb->edu_hdl);
-
-       m_NCS_EDU_HDL_FLUSH(&cb->edu_hdl_avnd);
-
-       m_NCS_EDU_HDL_FLUSH(&cb->edu_hdl_ava);
-
- done:
-       TRACE_LEAVE();
-       return rc;
-}
-
-/****************************************************************************
-   Name          : avnd_mbx_clean
-  
-   Description   : This routine dequeues & deletes all the events from the 
-                   mailbox. It is invoked when mailbox is detached.
-  
-   Arguments     : arg - argument to be passed
-                   msg - ptr to the 1st event in the mailbox
-  
-   Return Values : true/false
-  
-   Notes         : None.
- *****************************************************************************/
-bool avnd_mbx_clean(NCSCONTEXT arg, NCSCONTEXT msg) -{
-       AVND_EVT *curr;
-       AVND_EVT *temp;
-       TRACE_ENTER();
-
-       /* clean the entire mailbox */
-       for (curr = (AVND_EVT *)msg; curr;) {
-               temp = curr;
-               curr = curr->next;
-               avnd_evt_destroy(temp);
-       }
-
-       TRACE_LEAVE();
-       return true;
-}
-
-/****************************************************************************
    Name          : avnd_sigusr1_handler
   
    Description   : This routine handles the TERM signal sent by the start/stop 
script.
diff --git a/osaf/services/saf/amf/amfnd/mds.cc 
b/osaf/services/saf/amf/amfnd/mds.cc
--- a/osaf/services/saf/amf/amfnd/mds.cc
+++ b/osaf/services/saf/amf/amfnd/mds.cc
@@ -184,9 +184,6 @@ uint32_t avnd_mds_reg(AVND_CB *cb)
        cb->is_avd_down = false;
 
  done:
-       if (NCSCC_RC_SUCCESS != rc)
-               rc = avnd_mds_unreg(cb);
-
        return rc;
 }
 
@@ -254,37 +251,6 @@ uint32_t avnd_mds_vdest_reg(AVND_CB *cb)  }
 
 /****************************************************************************
-  Name          : avnd_mds_unreg
- 
-  Description   : This routine unregisters the AVND Service from MDS.
- 
-  Arguments     : cb - ptr to the AVND control block
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None.
-******************************************************************************/
-uint32_t avnd_mds_unreg(AVND_CB *cb)
-{
-       NCSMDS_INFO mds_info;
-       uint32_t rc = NCSCC_RC_SUCCESS;
-
-       memset(&mds_info, 0, sizeof(NCSMDS_INFO));
-
-       mds_info.i_mds_hdl = cb->mds_hdl;
-       mds_info.i_svc_id = NCSMDS_SVC_ID_AVND;
-       mds_info.i_op = MDS_UNINSTALL;
-
-       rc = ncsmds_api(&mds_info);
-       if (NCSCC_RC_SUCCESS != rc)
-               LOG_CR("Unregistration with MDS failed");
-       else
-               TRACE("Unregistration with MDS success");
-
-       return rc;
-}
-
-/****************************************************************************
   Name          : avnd_mds_cbk
  
   Description   : This routine is a callback routine that is provided to MDS.
diff --git a/osaf/services/saf/amf/amfnd/mon.cc 
b/osaf/services/saf/amf/amfnd/mon.cc
--- a/osaf/services/saf/amf/amfnd/mon.cc
+++ b/osaf/services/saf/amf/amfnd/mon.cc
@@ -74,37 +74,6 @@ void avnd_pid_mon_list_init(AVND_CB *cb)  }
 
 /****************************************************************************
-  Name          : avnd_pid_mon_list_destroy
-
-  Description   : This routine destroys the entire pid_mon_list. It deletes
-                  all the records in the list.
-
-  Arguments     : cb - ptr to the AvND control block
-
-  Return Values : nothing
-
-  Notes         : This dosen't destroy the records directly. It parses thru
-                  the mon_req's and get the corresponding PM_REC, del the
-                  PM_REC and as result the mon_req table entry will get
-                  deleted.
-******************************************************************************/
-void avnd_pid_mon_list_destroy(AVND_CB *cb) -{
-       NCS_DB_LINK_LIST *pid_mon_list;
-       AVND_MON_REQ *mon_req;
-
-       /* get pid_mon_list */
-       pid_mon_list = &cb->pid_mon_list;
-
-       /* traverse & delete all the MON records and their corresponding PM_REC 
*/
-       while (0 != (mon_req = (AVND_MON_REQ *) 
m_NCS_DBLIST_FIND_FIRST(pid_mon_list))) {
-               osafassert(mon_req->pm_rec);
-
-               avnd_comp_pm_rec_del(cb, mon_req->pm_rec->comp, 
mon_req->pm_rec);
-       }
-}
-
-/****************************************************************************
   Name          : avnd_mon_req_add
 
   Description   : This routine adds a request (node) to the pid_mon list. If
diff --git a/osaf/services/saf/amf/amfnd/pgdb.cc 
b/osaf/services/saf/amf/amfnd/pgdb.cc
--- a/osaf/services/saf/amf/amfnd/pgdb.cc
+++ b/osaf/services/saf/amf/amfnd/pgdb.cc
@@ -66,43 +66,6 @@ uint32_t avnd_pgdb_init(AVND_CB *cb)  }
 
 /****************************************************************************
-  Name          : avnd_pgdb_destroy
- 
-  Description   : This routine destroys the PG database.
- 
-  Arguments     : cb  - ptr to the AvND control block
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None.
-******************************************************************************/
-uint32_t avnd_pgdb_destroy(AVND_CB *cb) -{
-       AVND_PG *pg = 0;
-       uint32_t rc = NCSCC_RC_SUCCESS;
-
-       /* scan & delete each pg rec */
-       while (0 != (pg = (AVND_PG *)ncs_patricia_tree_getnext(&cb->pgdb, 
(uint8_t *)0))) {
-               /* delete the record */
-               rc = avnd_pgdb_rec_del(cb, &pg->csi_name);
-               if (NCSCC_RC_SUCCESS != rc)
-                       goto err;
-       }
-
-       /* finally destroy patricia tree */
-       rc = ncs_patricia_tree_destroy(&cb->pgdb);
-       if (NCSCC_RC_SUCCESS != rc)
-               goto err;
-
-       TRACE("PG DB destroy success");
-       return rc;
-
- err:
-       LOG_CR("PG DB destroy failed");
-       return rc;
-}
-
-/****************************************************************************
   Name          : avnd_pgdb_rec_add
  
   Description   : This routine adds a record to the PG database.
diff --git a/osaf/services/saf/amf/amfnd/proxydb.cc 
b/osaf/services/saf/amf/amfnd/proxydb.cc
--- a/osaf/services/saf/amf/amfnd/proxydb.cc
+++ b/osaf/services/saf/amf/amfnd/proxydb.cc
@@ -175,45 +175,6 @@ uint32_t avnd_nodeid_to_mdsdest_map_db_i  }
 
 /****************************************************************************
-  Name          : avnd_nodeid_to_mdsdest_map_db_destroy
- 
-  Description   : This routine destroys the node_id to mds dest mapping 
database.
-                  It deletes all the mapping records from the database.
- 
-  Arguments     : cb  - ptr to the AvND control block
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None.
-******************************************************************************/
-uint32_t avnd_nodeid_to_mdsdest_map_db_destroy(AVND_CB *cb) -{
-       AVND_NODEID_TO_MDSDEST_MAP *mapping = 0;
-       uint32_t rc = NCSCC_RC_SUCCESS;
-
-       /* scan & delete each su */
-       while (0 != (mapping =
-                    (AVND_NODEID_TO_MDSDEST_MAP 
*)ncs_patricia_tree_getnext(&cb->nodeid_mdsdest_db, (uint8_t *)0))) {
-               /* delete the record */
-               rc = avnd_nodeid_mdsdest_rec_del(cb, mapping->mds_dest);
-               if (NCSCC_RC_SUCCESS != rc)
-                       goto err;
-       }
-
-       /* finally destroy patricia tree */
-       rc = ncs_patricia_tree_destroy(&cb->nodeid_mdsdest_db);
-       if (NCSCC_RC_SUCCESS != rc)
-               goto err;
-
-       return rc;
-
- err:
-
-       LOG_ER("nodeid_to_mdsdest_map_db_destroy failed");
-       return rc;
-}
-
-/****************************************************************************
   Name          : avnd_internode_avail_comp_db_init
  
   Description   : This routine initializes the available internode components 
database.
@@ -241,45 +202,6 @@ uint32_t avnd_internode_avail_comp_db_in
        return rc;
 }
 
-/****************************************************************************
-  Name          : avnd_internode_avail_comp_db_destroy
- 
-  Description   : This routine destroys the available internode components 
database.
-                  It deletes all the components records from the database.
- 
-  Arguments     : cb  - ptr to the AvND control block
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None.
-******************************************************************************/
-uint32_t avnd_internode_avail_comp_db_destroy(AVND_CB *cb) -{
-       AVND_COMP *comp = 0;
-       uint32_t rc = NCSCC_RC_SUCCESS;
-
-       /* scan & delete each su */
-       while (0 != (comp = (AVND_COMP 
*)ncs_patricia_tree_getnext(&cb->internode_avail_comp_db, (uint8_t *)0))) {
-               /* delete the record */
-               m_AVND_SEND_CKPT_UPDT_ASYNC_RMV(cb, comp, 
AVND_CKPT_COMP_CONFIG);
-               rc = avnd_internode_comp_del(cb, &cb->internode_avail_comp_db, 
&comp->name);
-               if (NCSCC_RC_SUCCESS != rc)
-                       goto err;
-       }
-
-       /* finally destroy patricia tree */
-       rc = ncs_patricia_tree_destroy(&cb->internode_avail_comp_db);
-       if (NCSCC_RC_SUCCESS != rc)
-               goto err;
-
-       return rc;
-
- err:
-
-       LOG_ER("internode_avail_comp_db_destroy failed");
-       return rc;
-}
-
 /******************************************************************************
   Name          : avnd_internode_comp_add
  
diff --git a/osaf/services/saf/amf/amfnd/sudb.cc 
b/osaf/services/saf/amf/amfnd/sudb.cc
--- a/osaf/services/saf/amf/amfnd/sudb.cc
+++ b/osaf/services/saf/amf/amfnd/sudb.cc
@@ -59,48 +59,6 @@ uint32_t avnd_sudb_init(AVND_CB *cb)  }
 
 /****************************************************************************
-  Name          : avnd_sudb_destroy
- 
-  Description   : This routine destroys the SU database. It deletes all the 
-                  SU records in the database.
- 
-  Arguments     : cb  - ptr to the AvND control block
-
-  Return Values : NCSCC_RC_SUCCESS/NCSCC_RC_FAILURE
- 
-  Notes         : None.
-******************************************************************************/
-uint32_t avnd_sudb_destroy(AVND_CB *cb) -{
-       AVND_SU *su = 0;
-       uint32_t rc = NCSCC_RC_SUCCESS;
-
-       /* scan & delete each su */
-       while (0 != (su = (AVND_SU *)ncs_patricia_tree_getnext(&cb->sudb, 
(uint8_t *)0))) {
-               /* delete the record 
-                  m_AVND_SEND_CKPT_UPDT_ASYNC_RMV(cb, su, AVND_CKPT_SU_CONFIG);
-                  AvND is going down, but don't send any async update even for 
-                  external components, otherwise external components will be 
deleted
-                  from ACT. */
-               rc = avnd_sudb_rec_del(cb, &su->name);
-               if (NCSCC_RC_SUCCESS != rc)
-                       goto err;
-       }
-
-       /* finally destroy patricia tree */
-       rc = ncs_patricia_tree_destroy(&cb->sudb);
-       if (NCSCC_RC_SUCCESS != rc)
-               goto err;
-
-       TRACE("SU DB destroy success");
-       return rc;
-
- err:
-       LOG_CR("SU DB destroy failed");
-       return rc;
-}
-
-/****************************************************************************
   Name          : avnd_sudb_rec_add
  
   Description   : This routine adds a SU record to the SU database. If a SU 

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to