Update to SPDX v3.0 identifiers
[lttng-modules.git] / lib / ringbuffer / ring_buffer_mmap.c
index 30dd93ef6375ec5979fb9b45e3d00eb64a01c41e..c5abe84778d4a1d8c26adaf08cb19731df0959c4 100644 (file)
@@ -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 <karim@opersys.com>
  * Copyright (C) 2008-2012 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  *
- * 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.
  */
 
 /*
  * 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;
This page took 0.023051 seconds and 4 git commands to generate.