Rename struct channel to struct lttng_kernel_ring_buffer_channel
[lttng-modules.git] / src / lttng-abi.c
index aa1b0195eff6515ddee759871cc3fd4e25ee2f51..974aaff0b888e74504a814f584fa82bc488bdd62 100644 (file)
@@ -491,7 +491,7 @@ int lttng_abi_create_channel(struct file *session_file,
        struct lttng_kernel_session *session = session_file->private_data;
        const struct file_operations *fops = NULL;
        const char *transport_name;
-       struct lttng_channel *chan;
+       struct lttng_kernel_channel_buffer *chan;
        struct file *chan_file;
        int chan_fd;
        int ret = 0;
@@ -559,7 +559,7 @@ int lttng_abi_create_channel(struct file *session_file,
                ret = -EINVAL;
                goto chan_error;
        }
-       chan->file = chan_file;
+       chan->priv->parent.file = chan_file;
        chan_file->private_data = chan;
        fd_install(chan_fd, chan_file);
 
@@ -999,7 +999,7 @@ ssize_t lttng_event_notifier_group_notif_read(struct file *filp, char __user *us
                size_t count, loff_t *ppos)
 {
        struct lttng_event_notifier_group *event_notifier_group = filp->private_data;
-       struct channel *chan = event_notifier_group->chan;
+       struct lttng_kernel_ring_buffer_channel *chan = event_notifier_group->chan;
        struct lib_ring_buffer *buf = event_notifier_group->buf;
        ssize_t read_count = 0, len;
        size_t read_offset;
@@ -1105,7 +1105,7 @@ unsigned int lttng_event_notifier_group_notif_poll(struct file *filp,
 {
        unsigned int mask = 0;
        struct lttng_event_notifier_group *event_notifier_group = filp->private_data;
-       struct channel *chan = event_notifier_group->chan;
+       struct lttng_kernel_ring_buffer_channel *chan = event_notifier_group->chan;
        struct lib_ring_buffer *buf = event_notifier_group->buf;
        const struct lib_ring_buffer_config *config = &chan->backend.config;
        int finalized, disabled;
@@ -1315,7 +1315,7 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp,
        {
                struct lttng_metadata_stream *stream = filp->private_data;
                struct lib_ring_buffer *buf = stream->priv;
-               struct channel *chan = buf->backend.chan;
+               struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                ret = lttng_metadata_output_channel(stream, chan, NULL);
                if (ret > 0) {
@@ -1337,7 +1337,7 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp,
        {
                struct lttng_metadata_stream *stream = filp->private_data;
                struct lib_ring_buffer *buf = stream->priv;
-               struct channel *chan = buf->backend.chan;
+               struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                /*
                 * Before doing the actual ring buffer flush, write up to one
@@ -1364,7 +1364,7 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp,
        {
                struct lttng_metadata_stream *stream = filp->private_data;
                struct lib_ring_buffer *buf = stream->priv;
-               struct channel *chan = buf->backend.chan;
+               struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                ret = lttng_metadata_output_channel(stream, chan, &coherent);
                if (ret > 0) {
@@ -1424,7 +1424,7 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
        {
                struct lttng_metadata_stream *stream = filp->private_data;
                struct lib_ring_buffer *buf = stream->priv;
-               struct channel *chan = buf->backend.chan;
+               struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                ret = lttng_metadata_output_channel(stream, chan, NULL);
                if (ret > 0) {
@@ -1446,7 +1446,7 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
        {
                struct lttng_metadata_stream *stream = filp->private_data;
                struct lib_ring_buffer *buf = stream->priv;
-               struct channel *chan = buf->backend.chan;
+               struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                /*
                 * Before doing the actual ring buffer flush, write up to one
@@ -1473,7 +1473,7 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp,
        {
                struct lttng_metadata_stream *stream = filp->private_data;
                struct lib_ring_buffer *buf = stream->priv;
-               struct channel *chan = buf->backend.chan;
+               struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
 
                ret = lttng_metadata_output_channel(stream, chan, &coherent);
                if (ret > 0) {
@@ -1627,12 +1627,12 @@ fd_error:
 static
 int lttng_abi_open_stream(struct file *channel_file)
 {
-       struct lttng_channel *channel = channel_file->private_data;
+       struct lttng_kernel_channel_buffer *channel = channel_file->private_data;
        struct lib_ring_buffer *buf;
        int ret;
        void *stream_priv;
 
-       buf = channel->ops->priv->buffer_read_open(channel->chan);
+       buf = channel->ops->priv->buffer_read_open(channel->priv->rb_chan);
        if (!buf)
                return -ENOENT;
 
@@ -1653,14 +1653,14 @@ fd_error:
 static
 int lttng_abi_open_metadata_stream(struct file *channel_file)
 {
-       struct lttng_channel *channel = channel_file->private_data;
-       struct lttng_kernel_session *session = channel->session;
+       struct lttng_kernel_channel_buffer *channel = channel_file->private_data;
+       struct lttng_kernel_session *session = channel->parent.session;
        struct lib_ring_buffer *buf;
        int ret;
        struct lttng_metadata_stream *metadata_stream;
        void *stream_priv;
 
-       buf = channel->ops->priv->buffer_read_open(channel->chan);
+       buf = channel->ops->priv->buffer_read_open(channel->priv->rb_chan);
        if (!buf)
                return -ENOENT;
 
@@ -1674,7 +1674,7 @@ int lttng_abi_open_metadata_stream(struct file *channel_file)
        init_waitqueue_head(&metadata_stream->read_wait);
        metadata_stream->priv = buf;
        stream_priv = metadata_stream;
-       metadata_stream->transport = channel->transport;
+       metadata_stream->transport = channel->priv->transport;
        /* Initial state is an empty metadata, considered as incoherent. */
        metadata_stream->coherent = false;
 
@@ -1720,7 +1720,7 @@ static
 int lttng_abi_open_event_notifier_group_stream(struct file *notif_file)
 {
        struct lttng_event_notifier_group *event_notifier_group = notif_file->private_data;
-       struct channel *chan = event_notifier_group->chan;
+       struct lttng_kernel_ring_buffer_channel *chan = event_notifier_group->chan;
        struct lib_ring_buffer *buf;
        int ret;
        void *stream_priv;
@@ -1808,7 +1808,7 @@ int lttng_abi_create_event(struct file *channel_file,
                           struct lttng_kernel_abi_event *event_param)
 {
        const struct file_operations *fops;
-       struct lttng_channel *channel = channel_file->private_data;
+       struct lttng_kernel_channel_buffer *channel = channel_file->private_data;
        int event_fd, ret;
        struct file *event_file;
        void *priv;
@@ -2342,7 +2342,7 @@ static const struct file_operations lttng_event_notifier_group_fops = {
 static
 long lttng_channel_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-       struct lttng_channel *channel = file->private_data;
+       struct lttng_kernel_channel_buffer *channel = file->private_data;
 
        switch (cmd) {
        case LTTNG_KERNEL_ABI_OLD_STREAM:
@@ -2465,7 +2465,7 @@ old_event_end:
 
                ret = lttng_abi_add_context(file,
                                ucontext_param,
-                               &channel->ctx, channel->session);
+                               &channel->priv->ctx, channel->parent.session);
 
 old_ctx_error_free_old_param:
                kfree(old_ucontext_param);
@@ -2484,7 +2484,7 @@ old_ctx_end:
                        return -EFAULT;
                return lttng_abi_add_context(file,
                                &ucontext_param,
-                               &channel->ctx, channel->session);
+                               &channel->priv->ctx, channel->parent.session);
        }
        case LTTNG_KERNEL_ABI_OLD_ENABLE:
        case LTTNG_KERNEL_ABI_ENABLE:
@@ -2533,19 +2533,19 @@ long lttng_metadata_ioctl(struct file *file, unsigned int cmd, unsigned long arg
  */
 unsigned int lttng_channel_poll(struct file *file, poll_table *wait)
 {
-       struct lttng_channel *channel = file->private_data;
+       struct lttng_kernel_channel_buffer *channel = file->private_data;
        unsigned int mask = 0;
 
        if (file->f_mode & FMODE_READ) {
                poll_wait_set_exclusive(wait);
-               poll_wait(file, channel->ops->priv->get_hp_wait_queue(channel->chan),
+               poll_wait(file, channel->ops->priv->get_hp_wait_queue(channel->priv->rb_chan),
                          wait);
 
-               if (channel->ops->priv->is_disabled(channel->chan))
+               if (channel->ops->priv->is_disabled(channel->priv->rb_chan))
                        return POLLERR;
-               if (channel->ops->priv->is_finalized(channel->chan))
+               if (channel->ops->priv->is_finalized(channel->priv->rb_chan))
                        return POLLHUP;
-               if (channel->ops->priv->buffer_has_read_closed_stream(channel->chan))
+               if (channel->ops->priv->buffer_has_read_closed_stream(channel->priv->rb_chan))
                        return POLLIN | POLLRDNORM;
                return 0;
        }
@@ -2556,20 +2556,20 @@ unsigned int lttng_channel_poll(struct file *file, poll_table *wait)
 static
 int lttng_channel_release(struct inode *inode, struct file *file)
 {
-       struct lttng_channel *channel = file->private_data;
+       struct lttng_kernel_channel_buffer *channel = file->private_data;
 
        if (channel)
-               fput(channel->session->priv->file);
+               fput(channel->parent.session->priv->file);
        return 0;
 }
 
 static
 int lttng_metadata_channel_release(struct inode *inode, struct file *file)
 {
-       struct lttng_channel *channel = file->private_data;
+       struct lttng_kernel_channel_buffer *channel = file->private_data;
 
        if (channel) {
-               fput(channel->session->priv->file);
+               fput(channel->parent.session->priv->file);
                lttng_metadata_channel_destroy(channel);
        }
 
@@ -2696,7 +2696,7 @@ int lttng_event_recorder_event_release(struct inode *inode, struct file *file)
        struct lttng_kernel_event_recorder *event = file->private_data;
 
        if (event)
-               fput(event->chan->file);
+               fput(event->chan->priv->parent.file);
        return 0;
 }
 
@@ -2706,7 +2706,7 @@ int lttng_event_recorder_enabler_release(struct inode *inode, struct file *file)
        struct lttng_event_enabler *event_enabler = file->private_data;
 
        if (event_enabler)
-               fput(event_enabler->chan->file);
+               fput(event_enabler->chan->priv->parent.file);
        return 0;
 }
 
@@ -2742,7 +2742,7 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp,
                unsigned int cmd, unsigned long arg)
 {
        struct lib_ring_buffer *buf = filp->private_data;
-       struct channel *chan = buf->backend.chan;
+       struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
        const struct lib_ring_buffer_config *config = &chan->backend.config;
        const struct lttng_kernel_channel_buffer_ops *ops = chan->backend.priv_ops;
        int ret;
@@ -2846,7 +2846,7 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp,
                unsigned int cmd, unsigned long arg)
 {
        struct lib_ring_buffer *buf = filp->private_data;
-       struct channel *chan = buf->backend.chan;
+       struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan;
        const struct lib_ring_buffer_config *config = &chan->backend.config;
        const struct lttng_kernel_channel_buffer_ops *ops = chan->backend.priv_ops;
        int ret;
This page took 0.027439 seconds and 4 git commands to generate.