X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=lib%2Fringbuffer%2Fring_buffer_mmap.c;h=c172fee7cfab9e2632e68adb9c617ab8e8c2fa43;hb=d83004aa718065e5221d8ef4b99e4302b70b3df9;hp=c9d6e89a76955fbf0f062413e1c6fba1feb98df5;hpb=733ce41dc418c2b7ea1c8c6d569f7951836b29f8;p=lttng-modules.git diff --git a/lib/ringbuffer/ring_buffer_mmap.c b/lib/ringbuffer/ring_buffer_mmap.c index c9d6e89a..c172fee7 100644 --- a/lib/ringbuffer/ring_buffer_mmap.c +++ b/lib/ringbuffer/ring_buffer_mmap.c @@ -3,11 +3,23 @@ * * Copyright (C) 2002-2005 - Tom Zanussi , IBM Corp * Copyright (C) 1999-2005 - Karim Yaghmour - * Copyright (C) 2008-2010 - Mathieu Desnoyers + * Copyright (C) 2008-2012 - Mathieu Desnoyers * - * Re-using content from kernel/relay.c. + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; only version 2 of the License. * - * This file is released under the GPL v2. + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Re-using code from kernel/relay.c, hence the GPLv2 license for this + * file. */ #include @@ -24,7 +36,7 @@ static int lib_ring_buffer_fault(struct vm_area_struct *vma, struct vm_fault *vm { struct lib_ring_buffer *buf = vma->vm_private_data; 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; pgoff_t pgoff = vmf->pgoff; struct page **page; void **virt; @@ -74,7 +86,7 @@ static int lib_ring_buffer_mmap_buf(struct lib_ring_buffer *buf, { unsigned long length = vma->vm_end - vma->vm_start; 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; unsigned long mmap_buf_len; if (config->output != RING_BUFFER_MMAP) @@ -94,16 +106,23 @@ static int lib_ring_buffer_mmap_buf(struct lib_ring_buffer *buf, return 0; } +int lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma, + struct lib_ring_buffer *buf) +{ + return lib_ring_buffer_mmap_buf(buf, vma); +} +EXPORT_SYMBOL_GPL(lib_ring_buffer_mmap); + /** - * lib_ring_buffer_mmap - mmap file op + * vfs_lib_ring_buffer_mmap - mmap file op * @filp: the file * @vma: the vma describing what to map * * Calls upon lib_ring_buffer_mmap_buf() to map the file into user space. */ -int lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma) +int vfs_lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma) { struct lib_ring_buffer *buf = filp->private_data; - return lib_ring_buffer_mmap_buf(buf, vma); + return lib_ring_buffer_mmap(filp, vma, buf); } -EXPORT_SYMBOL_GPL(lib_ring_buffer_mmap); +EXPORT_SYMBOL_GPL(vfs_lib_ring_buffer_mmap);