lib: remove unused bt_graph_remove_unconnected_component()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 18 Oct 2019 17:37:43 +0000 (13:37 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 30 Oct 2019 19:14:53 +0000 (15:14 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ief672565ec2a597ae5e3d1bdfd46f7f12656d09b
Reviewed-on: https://review.lttng.org/c/babeltrace/+/2218
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
src/lib/graph/graph.c
src/lib/graph/graph.h

index 32af1ef898585d4c240f7e505c79de01970226be..44a5e1b4d657d98de328859f0df095734ea42e6b 100644 (file)
@@ -1506,83 +1506,6 @@ end:
        return status;
 }
 
-BT_HIDDEN
-int bt_graph_remove_unconnected_component(struct bt_graph *graph,
-               struct bt_component *component)
-{
-       bool init_can_consume;
-       uint64_t count;
-       uint64_t i;
-       int ret = 0;
-
-       BT_ASSERT(graph);
-       BT_ASSERT(component);
-       BT_ASSERT(component->base.ref_count == 0);
-       BT_ASSERT(bt_component_borrow_graph(component) == graph);
-
-       init_can_consume = graph->can_consume;
-       count = bt_component_get_input_port_count(component);
-
-       for (i = 0; i < count; i++) {
-               struct bt_port *port = (void *)
-                       bt_component_borrow_input_port_by_index(component, i);
-
-               BT_ASSERT(port);
-
-               if (bt_port_is_connected(port)) {
-                       BT_LIB_LOGW_APPEND_CAUSE(
-                               "Cannot remove component from graph: "
-                               "an input port is connected: "
-                               "%![graph-]+g, %![comp-]+c, %![port-]+p",
-                               graph, component, port);
-                       goto error;
-               }
-       }
-
-       count = bt_component_get_output_port_count(component);
-
-       for (i = 0; i < count; i++) {
-               struct bt_port *port = (void *)
-                       bt_component_borrow_output_port_by_index(component, i);
-
-               BT_ASSERT(port);
-
-               if (bt_port_is_connected(port)) {
-                       BT_LIB_LOGW_APPEND_CAUSE(
-                               "Cannot remove component from graph: "
-                               "an output port is connected: "
-                               "%![graph-]+g, %![comp-]+c, %![port-]+p",
-                               graph, component, port);
-                       goto error;
-               }
-       }
-
-       bt_graph_set_can_consume(graph, false);
-
-       /* Possibly remove from sinks to consume */
-       (void) g_queue_remove(graph->sinks_to_consume, component);
-
-       if (graph->sinks_to_consume->length == 0) {
-               graph->has_sink = false;
-       }
-
-       /*
-        * This calls bt_object_try_spec_release() on the component, and
-        * since its reference count is 0, its destructor is called. Its
-        * destructor calls the user's finalization method (if set).
-        */
-       g_ptr_array_remove(graph->components, component);
-       goto end;
-
-error:
-       ret = -1;
-
-end:
-       (void) init_can_consume;
-       bt_graph_set_can_consume(graph, init_can_consume);
-       return ret;
-}
-
 BT_HIDDEN
 void bt_graph_add_message(struct bt_graph *graph,
                struct bt_message *msg)
index 5fe6cb69fa0eb02c56e42f46f05e740be8525950..e18e63ffb0022a6d07c73a7e2d3d2589b4ce6647 100644 (file)
@@ -183,18 +183,6 @@ BT_HIDDEN
 void bt_graph_remove_connection(struct bt_graph *graph,
                struct bt_connection *connection);
 
-/*
- * This only works with a component which is not connected at this
- * point.
- *
- * Also the reference count of `component` should be 0 when you call
- * this function, which means only `graph` owns the component, so it
- * is safe to destroy.
- */
-BT_HIDDEN
-int bt_graph_remove_unconnected_component(struct bt_graph *graph,
-               struct bt_component *component);
-
 BT_HIDDEN
 void bt_graph_add_message(struct bt_graph *graph,
                struct bt_message *msg);
This page took 0.026281 seconds and 4 git commands to generate.