+ free(index_file);
+ return NULL;
+}
+
+void lttng_index_file_get(struct lttng_index_file *index_file)
+{
+ urcu_ref_get(&index_file->ref);
+}
+
+static void lttng_index_file_release(struct urcu_ref *ref)
+{
+ struct lttng_index_file *index_file = caa_container_of(ref,
+ struct lttng_index_file, ref);
+
+ if (close(index_file->fd)) {
+ PERROR("close index fd");
+ }
+ free(index_file);
+}
+
+void lttng_index_file_put(struct lttng_index_file *index_file)
+{
+ urcu_ref_put(&index_file->ref, lttng_index_file_release);