diff mbox

[lttng-modules,v2] Fix: changes to the vm_op fault cb prototype in libringbuffer

Message ID 1488900921-5050-1-git-send-email-francis.deslauriers@efficios.com
State Accepted, archived
Headers show

Commit Message

Francis Deslauriers March 7, 2017, 3:35 p.m. UTC
Signed-off-by: Francis Deslauriers <francis.deslauriers at efficios.com>
---
 lib/ringbuffer/ring_buffer_mmap.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Comments

Mathieu Desnoyers March 7, 2017, 3:37 p.m. UTC | #1
merged into master and stable-2.9, thanks!

Mathieu

----- On Mar 7, 2017, at 10:35 AM, Francis Deslauriers francis.deslauriers at efficios.com wrote:

> Signed-off-by: Francis Deslauriers <francis.deslauriers at efficios.com>
> ---
> lib/ringbuffer/ring_buffer_mmap.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/ringbuffer/ring_buffer_mmap.c
> b/lib/ringbuffer/ring_buffer_mmap.c
> index 35d30e7..4b1b7b3 100644
> --- a/lib/ringbuffer/ring_buffer_mmap.c
> +++ b/lib/ringbuffer/ring_buffer_mmap.c
> @@ -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.
>  */
> --
> 2.7.4
diff mbox

Patch

diff --git a/lib/ringbuffer/ring_buffer_mmap.c b/lib/ringbuffer/ring_buffer_mmap.c
index 35d30e7..4b1b7b3 100644
--- a/lib/ringbuffer/ring_buffer_mmap.c
+++ b/lib/ringbuffer/ring_buffer_mmap.c
@@ -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.
  */