X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=lib%2Fringbuffer%2Fring_buffer_mmap.c;h=c5abe84778d4a1d8c26adaf08cb19731df0959c4;hb=b7cdc18250880cc44edeef4a4b42c8ac7a135a6d;hp=30dd93ef6375ec5979fb9b45e3d00eb64a01c41e;hpb=9f36eaed6f91d5897924b551b44d1edd8cee00e2;p=lttng-modules.git diff --git a/lib/ringbuffer/ring_buffer_mmap.c b/lib/ringbuffer/ring_buffer_mmap.c index 30dd93ef..c5abe847 100644 --- a/lib/ringbuffer/ring_buffer_mmap.c +++ b/lib/ringbuffer/ring_buffer_mmap.c @@ -1,4 +1,4 @@ -/* SPDX-License-Identifier: GPL-2.0 +/* SPDX-License-Identifier: GPL-2.0-only * * ring_buffer_mmap.c * @@ -6,7 +6,7 @@ * Copyright (C) 1999-2005 - Karim Yaghmour * Copyright (C) 2008-2012 - Mathieu Desnoyers * - * Re-using code from kernel/relay.c, hence the GPL-2.0 license for this + * Re-using code from kernel/relay.c, hence the GPL-2.0-only license for this * file. */ @@ -20,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; @@ -53,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;