License cleanup, ifdef namespace cleanup
[lttng-modules.git] / lib / ringbuffer / ring_buffer_iterator.c
index df8d485ab92af72953049a115b0ac074a038aebb..e7c6cb7f91765d96c8c024f1e801373e91e06eca 100644 (file)
@@ -1,16 +1,28 @@
 /*
  * ring_buffer_iterator.c
  *
- * (C) Copyright 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
  * Ring buffer and channel iterators. Get each event of a channel in order. Uses
  * a prio heap for per-cpu buffers, giving a O(log(NR_CPUS)) algorithmic
  * complexity for the "get next event" operation.
  *
+ * Copyright (C) 2010-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; only
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
  * Author:
  *     Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * Dual LGPL v2.1/GPL v2 license.
  */
 
 #include "../../wrapper/ringbuffer/iterator.h"
@@ -40,7 +52,7 @@
 ssize_t lib_ring_buffer_get_next_record(struct channel *chan,
                                        struct lib_ring_buffer *buf)
 {
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
        struct lib_ring_buffer_iter *iter = &buf->iter;
        int ret;
 
@@ -225,7 +237,7 @@ void lib_ring_buffer_wait_for_qs(const struct lib_ring_buffer_config *config,
 ssize_t channel_get_next_record(struct channel *chan,
                                struct lib_ring_buffer **ret_buf)
 {
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
        struct lib_ring_buffer *buf;
        struct lttng_ptr_heap *heap;
        ssize_t len;
@@ -333,7 +345,7 @@ void lib_ring_buffer_iterator_init(struct channel *chan, struct lib_ring_buffer
        }
 
        /* Add to list of buffers without any current record */
-       if (chan->backend.config->alloc == RING_BUFFER_ALLOC_PER_CPU)
+       if (chan->backend.config.alloc == RING_BUFFER_ALLOC_PER_CPU)
                list_add(&buf->iter.empty_node, &chan->iter.empty_head);
 }
 
@@ -347,7 +359,7 @@ int __cpuinit channel_iterator_cpu_hotplug(struct notifier_block *nb,
        struct channel *chan = container_of(nb, struct channel,
                                            hp_iter_notifier);
        struct lib_ring_buffer *buf = per_cpu_ptr(chan->backend.buf, cpu);
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
 
        if (!chan->hp_iter_enable)
                return NOTIFY_DONE;
@@ -369,7 +381,7 @@ int __cpuinit channel_iterator_cpu_hotplug(struct notifier_block *nb,
 
 int channel_iterator_init(struct channel *chan)
 {
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
        struct lib_ring_buffer *buf;
 
        if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
@@ -413,7 +425,7 @@ int channel_iterator_init(struct channel *chan)
 
 void channel_iterator_unregister_notifiers(struct channel *chan)
 {
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
 
        if (config->alloc == RING_BUFFER_ALLOC_PER_CPU) {
                chan->hp_iter_enable = 0;
@@ -423,7 +435,7 @@ void channel_iterator_unregister_notifiers(struct channel *chan)
 
 void channel_iterator_free(struct channel *chan)
 {
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
 
        if (config->alloc == RING_BUFFER_ALLOC_PER_CPU)
                lttng_heap_free(&chan->iter.heap);
@@ -432,7 +444,7 @@ void channel_iterator_free(struct channel *chan)
 int lib_ring_buffer_iterator_open(struct lib_ring_buffer *buf)
 {
        struct channel *chan = buf->backend.chan;
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
        CHAN_WARN_ON(chan, config->output != RING_BUFFER_ITERATOR);
        return lib_ring_buffer_open_read(buf);
 }
@@ -451,7 +463,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_iterator_release);
 
 int channel_iterator_open(struct channel *chan)
 {
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
        struct lib_ring_buffer *buf;
        int ret = 0, cpu;
 
@@ -484,7 +496,7 @@ EXPORT_SYMBOL_GPL(channel_iterator_open);
 
 void channel_iterator_release(struct channel *chan)
 {
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
        struct lib_ring_buffer *buf;
        int cpu;
 
@@ -527,7 +539,7 @@ void lib_ring_buffer_iterator_reset(struct lib_ring_buffer *buf)
 
 void channel_iterator_reset(struct channel *chan)
 {
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
        struct lib_ring_buffer *buf;
        int cpu;
 
@@ -558,7 +570,7 @@ ssize_t channel_ring_buffer_file_read(struct file *filp,
                                      struct lib_ring_buffer *buf,
                                      int fusionmerge)
 {
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
        size_t read_count = 0, read_offset;
        ssize_t len;
 
@@ -706,7 +718,7 @@ ssize_t channel_file_read(struct file *filp,
 {
        struct inode *inode = filp->f_dentry->d_inode;
        struct channel *chan = inode->i_private;
-       const struct lib_ring_buffer_config *config = chan->backend.config;
+       const struct lib_ring_buffer_config *config = &chan->backend.config;
 
        if (config->alloc == RING_BUFFER_ALLOC_PER_CPU)
                return channel_ring_buffer_file_read(filp, user_buf, count,
@@ -780,6 +792,7 @@ int channel_file_release(struct inode *inode, struct file *file)
 }
 
 const struct file_operations channel_payload_file_operations = {
+       .owner = THIS_MODULE,
        .open = channel_file_open,
        .release = channel_file_release,
        .read = channel_file_read,
@@ -788,6 +801,7 @@ const struct file_operations channel_payload_file_operations = {
 EXPORT_SYMBOL_GPL(channel_payload_file_operations);
 
 const struct file_operations lib_ring_buffer_payload_file_operations = {
+       .owner = THIS_MODULE,
        .open = lib_ring_buffer_file_open,
        .release = lib_ring_buffer_file_release,
        .read = lib_ring_buffer_file_read,
This page took 0.025428 seconds and 4 git commands to generate.