[asterisk-commits] mmichelson: branch group/CCSS r226605 - /team/group/CCSS/main/ccss.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 29 15:55:03 CDT 2009


Author: mmichelson
Date: Thu Oct 29 15:55:00 2009
New Revision: 226605

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=226605
Log:
Use the handy find_cc_core_instance function where we can.


Modified:
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=226605&r1=226604&r2=226605
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Thu Oct 29 15:55:00 2009
@@ -2191,9 +2191,8 @@
 static int cc_monitor_tree_init(const int core_id)
 {
 	struct cc_core_instance *core_instance;
-	struct cc_core_instance instance_finder = { .core_id = core_id };
-
-	if (!(core_instance = ao2_t_find(cc_core_instances, &instance_finder, OBJ_POINTER, "Find the core instance"))) {
+
+	if (!(core_instance = find_cc_core_instance(core_id))) {
 		return -1;
 	}
 
@@ -2233,12 +2232,11 @@
 static int pass_availability_up(struct ast_cc_monitor *monitor, int core_id)
 {
 	struct cc_core_instance *core_instance;
-	struct cc_core_instance finder = { .core_id = core_id };
 	struct ast_cc_monitor_link *link;
 	ast_assert(monitor->interface->monitor_class == AST_CC_EXTENSION_MONITOR ||
 			monitor->interface->monitor_class == AST_CC_ROOT_MONITOR);
 
-	if (!(core_instance = ao2_t_find(cc_core_instances, &finder, OBJ_POINTER, "Find core instance for passing up availability"))) {
+	if (!(core_instance = find_cc_core_instance(core_id))) {
 		return -1;
 	}
 
@@ -2534,13 +2532,12 @@
 {
 	struct cc_state_change_args *args = datap;
 	struct cc_core_instance *core_instance;
-	struct cc_core_instance finder = { .core_id = args->core_id };
 	enum cc_state previous_state;
 	int res;
 
 	ast_log_dynamic_level(cc_logger_level, "State change to %d requested. Reason: %s\n", args->state, args->debug);
 
-	if (!(core_instance = ao2_t_find(cc_core_instances, &finder, OBJ_POINTER, "Find core instance so state change can occur"))) {
+	if (!(core_instance = find_cc_core_instance(args->core_id))) {
 		ast_log_dynamic_level(cc_logger_level, "Unable to find core instance %d\n", args->core_id);
 		ast_free(args);
 		return -1;
@@ -2738,7 +2735,6 @@
 	struct ast_datastore *recall_datastore = ast_datastore_alloc(&recall_ds_info, NULL);
 	struct cc_recall_ds_data *recall_data;
 	struct cc_core_instance *core_instance;
-	struct cc_core_instance finder = { .core_id = core_id };
 
 	if (!recall_datastore) {
 		return -1;
@@ -2749,8 +2745,7 @@
 		return -1;
 	}
 
-	if (!(core_instance = ao2_t_find(cc_core_instances, &finder, OBJ_POINTER,
-			"Find core_instance to set up recall datastore"))) {
+	if (!(core_instance = find_cc_core_instance(core_id))) {
 		ast_free(recall_data);
 		ast_datastore_free(recall_datastore);
 		return -1;




More information about the asterisk-commits mailing list