From eb836862527b18c26efceb7d3e5b347b5a88b689 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 30 Jul 2024 20:32:50 +0000 Subject: [PATCH] relayd: ctf-trace.cpp: iterate on rcu list using rcu_list_iteration_adapter MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I5c16d02d44fc90b9bf9336ac6cd795398d4ab4f5 Signed-off-by: Jérémie Galarneau --- src/bin/lttng-relayd/ctf-trace.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bin/lttng-relayd/ctf-trace.cpp b/src/bin/lttng-relayd/ctf-trace.cpp index f6a4b2dcd..86fee71c7 100644 --- a/src/bin/lttng-relayd/ctf-trace.cpp +++ b/src/bin/lttng-relayd/ctf-trace.cpp @@ -177,17 +177,16 @@ void ctf_trace_put(struct ctf_trace *trace) int ctf_trace_close(struct ctf_trace *trace) { - struct relay_stream *stream; - - const lttng::urcu::read_lock_guard read_lock; - cds_list_for_each_entry_rcu(stream, &trace->stream_list, stream_node) - { + for (auto *stream : + lttng::urcu::rcu_list_iteration_adapter( + trace->stream_list)) { /* * Close stream since the connection owning the trace is being * torn down. */ try_stream_close(stream); } + /* * Since all references to the trace are held by its streams, we * don't need to do any self-ref put. -- 2.34.1