- if (vstream->metadata_flag) {
- ctf_trace->viewer_metadata_stream = vstream;
- }
-
- /* Globally visible after the add unique. */
- lttng_ht_node_init_u64(&vstream->stream_n, stream->stream_handle);
- lttng_ht_add_unique_u64(viewer_streams_ht, &vstream->stream_n);
-
- vstream->index_read_fd = -1;
- vstream->read_fd = -1;
-
- /*
- * This is to avoid a race between the initialization of this object and
- * the close of the given stream. If the stream is unable to find this
- * viewer stream when closing, this copy will at least take the latest
- * value. We also need that for the seek_last.
- */
- vstream->total_index_received = stream->total_index_received;
-