The refcount increment is removed from the add metadata stream function
so for both kernel and UST, the increment is done once the stream is
allocated and the channel reference is set.
Signed-off-by: David Goulet <dgoulet@efficios.com>
uatomic_inc(&relayd->refcount);
}
- /* Update channel refcount once added without error(s). */
- uatomic_inc(&stream->chan->refcount);
-
/*
* When nb_init_stream_left reaches 0, we don't need to trigger any action
* in terms of destroying the associated channel, because the action that
new_stream->chan = channel;
new_stream->wait_fd = fd;
- /* Metadata chan refcount is increment in add_metadata_stream */
- if (new_stream->chan->type != CONSUMER_CHANNEL_TYPE_METADATA) {
- /* Update channel refcount */
- uatomic_inc(&new_stream->chan->refcount);
- }
+ /*
+ * We've just assigned the channel to the stream so increment the
+ * refcount right now.
+ */
+ uatomic_inc(&new_stream->chan->refcount);
/*
* The buffer flush is done on the session daemon side for the kernel