wrapper: remove file.h wrapper
[lttng-modules.git] / lib / ringbuffer / ring_buffer_iterator.c
index b6bec48d0dfc94e0dd5c3d7337ce0f1d17bd12ae..df09aabc1afc49fb936e1ece33948dbcd008bc02 100644 (file)
@@ -1,4 +1,5 @@
-/*
+/* SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
+ *
  * ring_buffer_iterator.c
  *
  * Ring buffer and channel iterators. Get each event of a channel in order. Uses
@@ -6,27 +7,11 @@
  * 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>
  */
 
 #include <wrapper/ringbuffer/iterator.h>
-#include <wrapper/file.h>
+#include <linux/file.h>
+#include <linux/uaccess.h>
 #include <linux/jiffies.h>
 #include <linux/delay.h>
 #include <linux/module.h>
@@ -61,7 +46,7 @@ restart:
        switch (iter->state) {
        case ITER_GET_SUBBUF:
                ret = lib_ring_buffer_get_next_subbuf(buf);
-               if (ret && !ACCESS_ONCE(buf->finalized)
+               if (ret && !READ_ONCE(buf->finalized)
                    && config->alloc == RING_BUFFER_ALLOC_GLOBAL) {
                        /*
                         * Use "pull" scheme for global buffers. The reader
@@ -621,7 +606,7 @@ ssize_t channel_ring_buffer_file_read(struct file *filp,
        ssize_t len;
 
        might_sleep();
-       if (!access_ok(VERIFY_WRITE, user_buf, count))
+       if (!access_ok(user_buf, count))
                return -EFAULT;
 
        /* Finish copy of previous record */
@@ -737,7 +722,7 @@ ssize_t lib_ring_buffer_file_read(struct file *filp,
                                  size_t count,
                                  loff_t *ppos)
 {
-       struct inode *inode = filp->lttng_f_dentry->d_inode;
+       struct inode *inode = filp->f_path.dentry->d_inode;
        struct lib_ring_buffer *buf = inode->i_private;
        struct channel *chan = buf->backend.chan;
 
@@ -762,7 +747,7 @@ ssize_t channel_file_read(struct file *filp,
                          size_t count,
                          loff_t *ppos)
 {
-       struct inode *inode = filp->lttng_f_dentry->d_inode;
+       struct inode *inode = filp->f_path.dentry->d_inode;
        struct channel *chan = inode->i_private;
        const struct lib_ring_buffer_config *config = &chan->backend.config;
 
This page took 0.024135 seconds and 4 git commands to generate.