+ lttng_trace_chunk_put(chunk);
+ free(index_file);
+ return NULL;
+}
+
+struct lttng_index_file *lttng_index_file_create_from_trace_chunk(
+ struct lttng_trace_chunk *chunk,
+ const char *channel_path, const char *stream_name,
+ uint64_t stream_file_size, uint64_t stream_file_index,
+ uint32_t index_major, uint32_t index_minor,
+ bool unlink_existing_file)
+{
+ return _lttng_index_file_create_from_trace_chunk(chunk, channel_path,
+ stream_name, stream_file_size, stream_file_index,
+ index_major, index_minor, unlink_existing_file,
+ WRITE_FILE_FLAGS);
+}
+
+struct lttng_index_file *lttng_index_file_create_from_trace_chunk_read_only(
+ struct lttng_trace_chunk *chunk,
+ const char *channel_path, const char *stream_name,
+ uint64_t stream_file_size, uint64_t stream_file_index,
+ uint32_t index_major, uint32_t index_minor)
+{
+ return _lttng_index_file_create_from_trace_chunk(chunk, channel_path,
+ stream_name, stream_file_size, stream_file_index,
+ index_major, index_minor, false,
+ READ_ONLY_FILE_FLAGS);