From: Jérémie Galarneau Date: Fri, 26 Jul 2024 20:47:01 +0000 (+0000) Subject: sessiond: rotation-thread.cpp: iterate on lfht using lfht_iteration_adapter X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8f75fc590976d014ef718e77e0d980237ba30b00;p=lttng-tools.git sessiond: rotation-thread.cpp: iterate on lfht using lfht_iteration_adapter Change-Id: I00f293b25e8747058c643ba63c07813a8d9a24ec Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/rotation-thread.cpp b/src/bin/lttng-sessiond/rotation-thread.cpp index a26f620b4..187f5bec1 100644 --- a/src/bin/lttng-sessiond/rotation-thread.cpp +++ b/src/bin/lttng-sessiond/rotation-thread.cpp @@ -116,8 +116,6 @@ void check_session_rotation_pending_on_consumers(const ltt_session::locked_ref& bool& _rotation_completed) { int ret = 0; - struct consumer_socket *socket; - struct cds_lfht_iter iter; enum consumer_trace_chunk_exists_status exists_status; uint64_t relayd_id; bool chunk_exists_on_peer = false; @@ -134,8 +132,10 @@ void check_session_rotation_pending_on_consumers(const ltt_session::locked_ref& goto skip_ust; } - cds_lfht_for_each_entry ( - session->ust_session->consumer->socks->ht, &iter, socket, node.node) { + for (auto *socket : lttng::urcu::lfht_iteration_adapter( + *session->ust_session->consumer->socks->ht)) { relayd_id = session->ust_session->consumer->type == CONSUMER_DST_LOCAL ? -1ULL : session->ust_session->consumer->net_seq_index; @@ -162,8 +162,10 @@ skip_ust: goto skip_kernel; } - cds_lfht_for_each_entry ( - session->kernel_session->consumer->socks->ht, &iter, socket, node.node) { + for (auto *socket : lttng::urcu::lfht_iteration_adapter( + *session->kernel_session->consumer->socks->ht)) { const lttng::pthread::lock_guard socket_lock(*socket->lock); relayd_id = session->kernel_session->consumer->type == CONSUMER_DST_LOCAL ?