X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=lib%2Fringbuffer%2Fring_buffer_mmap.c;h=fab945887855c0eb20967721b3cdc0b3f5dd21fb;hb=2ca0c84f0b4a915c555a0b83102d94ac941619ca;hp=4b1b7b310502c038c415a1b31a3b4f0e06d4140d;hpb=52a391bdd89e233e99cc3fbe1fdd7bbef694b876;p=lttng-modules.git diff --git a/lib/ringbuffer/ring_buffer_mmap.c b/lib/ringbuffer/ring_buffer_mmap.c index 4b1b7b31..fab94588 100644 --- a/lib/ringbuffer/ring_buffer_mmap.c +++ b/lib/ringbuffer/ring_buffer_mmap.c @@ -1,24 +1,12 @@ -/* +/* SPDX-License-Identifier: GPL-2.0 + * * ring_buffer_mmap.c * * Copyright (C) 2002-2005 - Tom Zanussi , IBM Corp * Copyright (C) 1999-2005 - Karim Yaghmour * Copyright (C) 2008-2012 - Mathieu Desnoyers * - * 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 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 + * Re-using code from kernel/relay.c, hence the GPL-2.0 license for this * file. */ @@ -32,7 +20,11 @@ /* * fault() vm_op implementation for ring buffer file mapping. */ +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) +static vm_fault_t lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fault *vmf) +#else static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fault *vmf) +#endif { struct lib_ring_buffer *buf = vma->vm_private_data; struct channel *chan = buf->backend.chan; @@ -65,7 +57,13 @@ static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fa return 0; } -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0)) +static vm_fault_t lib_ring_buffer_fault(struct vm_fault *vmf) +{ + struct vm_area_struct *vma = vmf->vma; + return lib_ring_buffer_fault_compat(vma, vmf); +} +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) static int lib_ring_buffer_fault(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma;