struct lttng_metadata_stream *stream = file->private_data;
struct lib_ring_buffer *buf = stream->priv;
+ mutex_lock(&stream->metadata_cache->lock);
+ list_del(&stream->list);
+ mutex_unlock(&stream->metadata_cache->lock);
kref_put(&stream->metadata_cache->refcount, metadata_cache_destroy);
module_put(stream->transport->owner);
+ kfree(stream);
return lib_ring_buffer_release(inode, file, buf);
}
if (ret < 0)
goto fd_error;
+ mutex_lock(&session->metadata_cache->lock);
list_add(&metadata_stream->list,
&session->metadata_cache->metadata_stream);
+ mutex_unlock(&session->metadata_cache->lock);
return ret;
fd_error:
if (atomic_dec_return(&session->metadata_cache->producing) == 0) {
struct lttng_metadata_stream *stream;
- mutex_unlock(&session->metadata_cache->lock);
list_for_each_entry(stream, &session->metadata_cache->metadata_stream, list)
wake_up_interruptible(&stream->read_wait);
+ mutex_unlock(&session->metadata_cache->lock);
}
}