From: Jérémie Galarneau Date: Tue, 30 Jul 2024 03:26:08 +0000 (+0000) Subject: sessiond: buffer-registry.cpp: iterate on list using list_iteration_adapter X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6e30139b24237745cad39fd63ab158b2689bd993;p=lttng-tools.git sessiond: buffer-registry.cpp: iterate on list using list_iteration_adapter Change-Id: I30a861585a5c5c398f9999ab2efa687a133e09e6 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/buffer-registry.cpp b/src/bin/lttng-sessiond/buffer-registry.cpp index fa04fdae5..1b83f4097 100644 --- a/src/bin/lttng-sessiond/buffer-registry.cpp +++ b/src/bin/lttng-sessiond/buffer-registry.cpp @@ -334,13 +334,14 @@ int buffer_reg_uid_consumer_channel_key(struct cds_list_head *buffer_reg_uid_lis uint64_t *consumer_chan_key) { int ret = -1; - buffer_reg_uid *uid_reg = nullptr; /* * For the per-uid registry, we have to iterate since we don't have the * uid and bitness key. */ - cds_list_for_each_entry (uid_reg, buffer_reg_uid_list, lnode) { + for (auto uid_reg : + lttng::urcu::list_iteration_adapter( + *buffer_reg_uid_list)) { auto *session_reg = uid_reg->registry; for (auto *reg_chan : lttng::urcu::lfht_iteration_adapterstreams, lnode) { - cds_list_del(&sreg->lnode); + for (auto reg_stream : + lttng::urcu::list_iteration_adapter( + regp->streams)) { + cds_list_del(®_stream->lnode); regp->stream_count--; - buffer_reg_stream_destroy(sreg, domain); + buffer_reg_stream_destroy(reg_stream, domain); } if (regp->obj.ust) {