From: Jérémie Galarneau Date: Mon, 22 Jul 2024 19:08:47 +0000 (+0000) Subject: relayd: viewer_stream: use lttng::utils::container_of X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=1b2a5aac93ae19663c5740865e0c1113cd662d9b;p=lttng-tools.git relayd: viewer_stream: use lttng::utils::container_of caa_container_of makes use of offsetof which is conditionally supported for non-POD types. Replace its use by lttng::utils::container_of. Change-Id: Ied676a7003749a82b0ae4eeb8a1bcedb0e081673 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/viewer-stream.cpp b/src/bin/lttng-relayd/viewer-stream.cpp index 6ea7d8898..e3061ec87 100644 --- a/src/bin/lttng-relayd/viewer-stream.cpp +++ b/src/bin/lttng-relayd/viewer-stream.cpp @@ -235,8 +235,7 @@ static void viewer_stream_unpublish(struct relay_viewer_stream *vstream) static void viewer_stream_release(struct urcu_ref *ref) { - struct relay_viewer_stream *vstream = - caa_container_of(ref, struct relay_viewer_stream, ref); + auto *vstream = lttng::utils::container_of(ref, &relay_viewer_stream::ref); if (vstream->stream->is_metadata) { rcu_assign_pointer(vstream->stream->trace->viewer_metadata_stream, NULL);