Fix: changes to the vm_op fault cb prototype in libringbuffer
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 7 Mar 2017 15:35:21 +0000 (10:35 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 7 Mar 2017 15:36:49 +0000 (10:36 -0500)
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_mmap.c

index 35d30e7ec75d2426d4b74f3debb3466eb07b74ba..4b1b7b310502c038c415a1b31a3b4f0e06d4140d 100644 (file)
@@ -32,7 +32,7 @@
 /*
  * fault() vm_op implementation for ring buffer file mapping.
  */
-static int lib_ring_buffer_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fault *vmf)
 {
        struct lib_ring_buffer *buf = vma->vm_private_data;
        struct channel *chan = buf->backend.chan;
@@ -65,6 +65,19 @@ static int lib_ring_buffer_fault(struct vm_area_struct *vma, struct vm_fault *vm
        return 0;
 }
 
+#if (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;
+       return lib_ring_buffer_fault_compat(vma, vmf);
+}
+#else /* #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
+static int lib_ring_buffer_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
+{
+       return lib_ring_buffer_fault_compat(vma, vmf);
+}
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
+
 /*
  * vm_ops for ring buffer file mappings.
  */
This page took 0.026787 seconds and 4 git commands to generate.