X-Git-Url: http://git.liburcu.org/?p=lttng-modules.git;a=blobdiff_plain;f=lib%2Fringbuffer%2Fring_buffer_iterator.c;h=15d7c75c15862b8ec4f47771dd98dc1eb8291c30;hp=b6bec48d0dfc94e0dd5c3d7337ce0f1d17bd12ae;hb=2459130397d7e7eecc44a5f06a39d65c78257eef;hpb=1e36732678d7cc650940b4508031acf2f6ffcd1b diff --git a/lib/ringbuffer/ring_buffer_iterator.c b/lib/ringbuffer/ring_buffer_iterator.c index b6bec48d..15d7c75c 100644 --- a/lib/ringbuffer/ring_buffer_iterator.c +++ b/lib/ringbuffer/ring_buffer_iterator.c @@ -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 - * - * 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 */ -#include +#include #include +#include #include #include #include @@ -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 (!lttng_access_ok(VERIFY_WRITE, user_buf, count)) return -EFAULT; /* Finish copy of previous record */