sessiond: buffer_reg_uid: use lttng::utils::container_of
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 22 Jul 2024 19:10:37 +0000 (19:10 +0000)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 30 Jul 2024 01:26:51 +0000 (01:26 +0000)
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: I96a42df9c82ad6b520d3b53a6445159bce692120
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/buffer-registry.cpp

index 9885ed6c8990b61e46839798b38379fdbdb784fe..bf1bd0a7ca221aea294b58172882319be109dc95 100644 (file)
@@ -39,15 +39,11 @@ static struct lttng_ht *buffer_registry_pid;
  */
 static int ht_match_reg_uid(struct cds_lfht_node *node, const void *_key)
 {
-       struct buffer_reg_uid *reg;
-       const struct buffer_reg_uid *key;
-
        LTTNG_ASSERT(node);
        LTTNG_ASSERT(_key);
 
-       reg = caa_container_of(node, struct buffer_reg_uid, node.node);
-       LTTNG_ASSERT(reg);
-       key = (buffer_reg_uid *) _key;
+       auto *reg = lttng_ht_node_container_of(node, &buffer_reg_uid::node);
+       const auto *key = (buffer_reg_uid *) _key;
 
        if (key->session_id != reg->session_id || key->bits_per_long != reg->bits_per_long ||
            key->uid != reg->uid) {
This page took 0.026196 seconds and 4 git commands to generate.