static
int lttng_abi_create_session(void)
{
- struct lttng_session *session;
+ struct lttng_kernel_session *session;
struct file *session_file;
int session_fd, ret;
ret = PTR_ERR(session_file);
goto file_error;
}
- session->file = session_file;
+ session->priv->file = session_file;
fd_install(session_fd, session_file);
return session_fd;
static
long lttng_abi_add_context(struct file *file,
struct lttng_kernel_abi_context *context_param,
- struct lttng_kernel_ctx **ctx, struct lttng_session *session)
+ struct lttng_kernel_ctx **ctx, struct lttng_kernel_session *session)
{
- if (session->been_active)
+ if (session->priv->been_active)
return -EPERM;
switch (context_param->ctx) {
struct lttng_kernel_abi_channel *chan_param,
enum channel_type channel_type)
{
- struct lttng_session *session = session_file->private_data;
+ struct lttng_kernel_session *session = session_file->private_data;
const struct file_operations *fops = NULL;
const char *transport_name;
struct lttng_channel *chan;
}
static
-int lttng_abi_session_set_name(struct lttng_session *session,
+int lttng_abi_session_set_name(struct lttng_kernel_session *session,
struct lttng_kernel_abi_session_name *name)
{
size_t len;
return -EINVAL;
}
- strcpy(session->name, name->name);
+ strcpy(session->priv->name, name->name);
return 0;
}
static
-int lttng_abi_session_set_creation_time(struct lttng_session *session,
+int lttng_abi_session_set_creation_time(struct lttng_kernel_session *session,
struct lttng_kernel_abi_session_creation_time *time)
{
size_t len;
return -EINVAL;
}
- strcpy(session->creation_time, time->iso8601);
+ strcpy(session->priv->creation_time, time->iso8601);
return 0;
}
static
long lttng_session_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
- struct lttng_session *session = file->private_data;
+ struct lttng_kernel_session *session = file->private_data;
struct lttng_kernel_abi_channel chan_param;
struct lttng_kernel_abi_old_channel old_chan_param;
static
int lttng_session_release(struct inode *inode, struct file *file)
{
- struct lttng_session *session = file->private_data;
+ struct lttng_kernel_session *session = file->private_data;
if (session)
lttng_session_destroy(session);
int lttng_abi_open_metadata_stream(struct file *channel_file)
{
struct lttng_channel *channel = channel_file->private_data;
- struct lttng_session *session = channel->session;
+ struct lttng_kernel_session *session = channel->session;
struct lib_ring_buffer *buf;
int ret;
struct lttng_metadata_stream *metadata_stream;
ret = -ENOMEM;
goto nomem;
}
- metadata_stream->metadata_cache = session->metadata_cache;
+ metadata_stream->metadata_cache = session->priv->metadata_cache;
init_waitqueue_head(&metadata_stream->read_wait);
metadata_stream->priv = buf;
stream_priv = metadata_stream;
goto notransport;
}
- if (!lttng_kref_get(&session->metadata_cache->refcount)) {
+ if (!lttng_kref_get(&session->priv->metadata_cache->refcount)) {
ret = -EOVERFLOW;
goto kref_error;
}
if (ret < 0)
goto fd_error;
- mutex_lock(&session->metadata_cache->lock);
+ mutex_lock(&session->priv->metadata_cache->lock);
list_add(&metadata_stream->list,
- &session->metadata_cache->metadata_stream);
- mutex_unlock(&session->metadata_cache->lock);
+ &session->priv->metadata_cache->metadata_stream);
+ mutex_unlock(&session->priv->metadata_cache->lock);
return ret;
fd_error:
- kref_put(&session->metadata_cache->refcount, metadata_cache_destroy);
+ kref_put(&session->priv->metadata_cache->refcount, metadata_cache_destroy);
kref_error:
module_put(metadata_stream->transport->owner);
notransport:
struct lttng_channel *channel = file->private_data;
if (channel)
- fput(channel->session->file);
+ fput(channel->session->priv->file);
return 0;
}
struct lttng_channel *channel = file->private_data;
if (channel) {
- fput(channel->session->file);
+ fput(channel->session->priv->file);
lttng_metadata_channel_destroy(channel);
}