X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Findex.cpp;h=e7846a5b9233b9141d6c9ffd48717aa188d93641;hb=b3647fb885288c63d21478ea9a9c85685bc5c5f2;hp=ef00a6eca103e1a3e53eb0e5470f00312b584aa0;hpb=ac497a37018f3c253d2e50397294f58d33f7f24f;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/index.cpp b/src/bin/lttng-relayd/index.cpp index ef00a6eca..e7846a5b9 100644 --- a/src/bin/lttng-relayd/index.cpp +++ b/src/bin/lttng-relayd/index.cpp @@ -9,14 +9,14 @@ #define _LGPL_SOURCE -#include -#include -#include +#include +#include +#include -#include "lttng-relayd.h" -#include "stream.h" -#include "index.h" -#include "connection.h" +#include "lttng-relayd.hpp" +#include "stream.hpp" +#include "index.hpp" +#include "connection.hpp" /* * Allocate a new relay index object. Pass the stream in which it is @@ -34,7 +34,7 @@ static struct relay_index *relay_index_create(struct relay_stream *stream, DBG2("Creating relay index for stream id %" PRIu64 " and seqnum %" PRIu64, stream->stream_handle, net_seq_num); - index = (relay_index *) zmalloc(sizeof(*index)); + index = zmalloc(); if (!index) { PERROR("Relay index zmalloc"); goto end; @@ -67,6 +67,8 @@ static struct relay_index *relay_index_add_unique(struct relay_stream *stream, struct cds_lfht_node *node_ptr; struct relay_index *_index; + ASSERT_RCU_READ_LOCKED(); + DBG2("Adding relay index with stream id %" PRIu64 " and seqnum %" PRIu64, stream->stream_handle, index->index_n.key); @@ -88,6 +90,8 @@ static struct relay_index *relay_index_add_unique(struct relay_stream *stream, */ static bool relay_index_get(struct relay_index *index) { + ASSERT_RCU_READ_LOCKED(); + DBG2("index get for stream id %" PRIu64 " and seqnum %" PRIu64 " refcount %d", index->stream->stream_handle, index->index_n.key, (int) index->ref.refcount); @@ -238,7 +242,7 @@ void relay_index_put(struct relay_index *index) index->stream->stream_handle, index->index_n.key, (int) index->ref.refcount); /* - * Ensure existance of index->lock for index unlock. + * Ensure existence of index->lock for index unlock. */ rcu_read_lock(); /*