[asterisk-commits] mmichelson: branch group/CCSS_Monitor_Restructure r242089 - /team/group/CCSS_...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jan 21 16:16:09 CST 2010
Author: mmichelson
Date: Thu Jan 21 16:16:06 2010
New Revision: 242089
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=242089
Log:
Remove unused pass_failure_up function.
Modified:
team/group/CCSS_Monitor_Restructure/main/ccss.c
Modified: team/group/CCSS_Monitor_Restructure/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS_Monitor_Restructure/main/ccss.c?view=diff&rev=242089&r1=242088&r2=242089
==============================================================================
--- team/group/CCSS_Monitor_Restructure/main/ccss.c (original)
+++ team/group/CCSS_Monitor_Restructure/main/ccss.c Thu Jan 21 16:16:06 2010
@@ -187,17 +187,6 @@
*/
static struct cc_core_instance *cc_core_init_instance(struct ast_channel *caller_chan,
struct ast_cc_interface_tree *called_tree, const int core_id, struct ast_control_cc_payload *cc_data);
-
-/*
- * \internal
- * \brief Pass monitor failure up the tree
- *
- * When a monitor has a failure, and it is determined that its parent has no
- * more child links with this particular core_id, we will pass the notification
- * upwards. If the notification reaches the root monitor, then the CC transaction
- * will fail completely.
- */
-static int pass_failure_up(struct ast_cc_monitor *monitor, const int core_id);
static const char *CC_LOGGER_LEVEL_NAME = "CC";
static int cc_logger_level;
@@ -2982,72 +2971,6 @@
int core_id;
};
-static int pass_failure_up(struct ast_cc_monitor *monitor, const int core_id)
-{
- struct ast_cc_monitor *parent_monitor = NULL;
- struct ast_cc_monitor_link *child_link_iter;
- struct ast_cc_monitor_link *parent_link_iter;
-
- if (monitor->interface->monitor_class == AST_CC_ROOT_MONITOR) {
- /* We've reached the top of the tree, which means that what may have
- * started as a localized failure has progressed to a global one instead.
- */
- ast_log_dynamic_level(cc_logger_level, "All monitors for core %d have failed\n", core_id);
- cc_unref(monitor, "monitor is the root. failure has reached the top");
- return ast_cc_failed(core_id, "All monitors have failed");
- }
-
- /* Since this is not the root monitor, there SHOULD be a parent link with the
- * correct core_id. We need to cut it away.
- */
- AST_LIST_TRAVERSE_SAFE_BEGIN(&monitor->parent_links, parent_link_iter, next_parent) {
- if (parent_link_iter->core_id == core_id) {
- parent_monitor = cc_ref(parent_link_iter->parent, "Found a parent monitor perhaps");
- AST_LIST_REMOVE_CURRENT(next_parent);
- parent_link_iter->child->callbacks->cancel_available_timer(parent_link_iter->parent,
- core_id, &parent_link_iter->child_avail_id);
- break;
- }
- }
- AST_LIST_TRAVERSE_SAFE_END;
-
- /* If this assertion fails, something is terribly wrong */
- ast_assert(parent_monitor != NULL);
- ast_assert(parent_link_iter != NULL);
- AST_LIST_REMOVE(&parent_monitor->child_links, parent_link_iter, next_child);
- destroy_link(parent_link_iter);
-
- if (AST_LIST_EMPTY(&monitor->child_links) && AST_LIST_EMPTY(&monitor->parent_links)) {
- /* No more links have references to this monitor, so unlink it */
- ao2_t_unlink(cc_monitors, monitor, "Failed monitor is an orphan. Unlink it");
- }
-
- cc_unref(monitor, "Monitor failure has been taken care of. Unref");
-
- /* Next determine if the parent monitor also needs to pass info up. If the parent monitor
- * has no more child links left with this core ID, then it means that it should also pass the
- * failure up.
- */
- AST_LIST_TRAVERSE(&parent_monitor->child_links, child_link_iter, next_child) {
- if (child_link_iter->core_id == core_id) {
- /* There are still child links with this core ID, so this
- * monitor should not pass a failure up the tree
- */
- cc_unref(parent_monitor, "Still child links available. Unref our local reference");
- return 0;
- }
- }
-
- /* The parent monitor is a monitor who no longer has any children with
- * this core_id. We need to pass the failure up to the next parent monitor in the tree.
- * This invocation of pass_failure_up will unref the parent_monitor. We don't need
- * to do it ourselves.
- */
- pass_failure_up(parent_monitor, core_id);
-
- return 0;
-}
-
static int cc_monitor_failed(void *data)
{
struct cc_monitor_failure_data *failure_data = data;
More information about the asterisk-commits
mailing list