From: Jérémie Galarneau Date: Wed, 31 Jul 2024 01:04:45 +0000 (+0000) Subject: sessiond: trace-ust.cpp: iterate on list using list_iteration_adapter X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f63885ecb2730c6d31f03e2f06f573620477b3d4;p=lttng-tools.git sessiond: trace-ust.cpp: iterate on list using list_iteration_adapter Change-Id: I20a5549e8a93b7fe0d111b72548af8e74d80531a Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/trace-ust.cpp b/src/bin/lttng-sessiond/trace-ust.cpp index 9a4e2b037..a298d6f55 100644 --- a/src/bin/lttng-sessiond/trace-ust.cpp +++ b/src/bin/lttng-sessiond/trace-ust.cpp @@ -1319,11 +1319,12 @@ void trace_ust_delete_channel(struct lttng_ht *ht, struct ltt_ust_channel *chann int trace_ust_regenerate_metadata(struct ltt_ust_session *usess) { int ret = 0; - struct buffer_reg_uid *uid_reg = nullptr; struct buffer_reg_session *session_reg = nullptr; const lttng::urcu::read_lock_guard read_lock; - cds_list_for_each_entry (uid_reg, &usess->buffer_reg_uid_list, lnode) { + for (auto uid_reg : + lttng::urcu::list_iteration_adapter( + usess->buffer_reg_uid_list)) { lsu::registry_session *registry; session_reg = uid_reg->registry; @@ -1376,8 +1377,6 @@ static void destroy_domain_global(struct ltt_ust_domain_global *dom) */ void trace_ust_destroy_session(struct ltt_ust_session *session) { - struct buffer_reg_uid *reg, *sreg; - LTTNG_ASSERT(session); DBG2("Trace UST destroy session %" PRIu64, session->id); @@ -1397,7 +1396,8 @@ void trace_ust_destroy_session(struct ltt_ust_session *session) lttng_ht_destroy(session->agents); /* Cleanup UID buffer registry object(s). */ - cds_list_for_each_entry_safe (reg, sreg, &session->buffer_reg_uid_list, lnode) { + for (auto reg : lttng::urcu::list_iteration_adapter( + session->buffer_reg_uid_list)) { cds_list_del(®->lnode); buffer_reg_uid_remove(reg); buffer_reg_uid_destroy(reg, session->consumer);