Re: [lttng-dev] [PATCH lttng-modules] Fix: changes to the vm_op fault cb prototype in libringbuffer

2017-03-07 Thread Mathieu Desnoyers


- On Mar 7, 2017, at 9:59 AM, Francis Deslauriers 
francis.deslauri...@efficios.com wrote:

> Signed-off-by: Francis Deslauriers 
> ---
> lib/ringbuffer/ring_buffer_mmap.c | 6 ++
> 1 file changed, 6 insertions(+)
> 
> diff --git a/lib/ringbuffer/ring_buffer_mmap.c
> b/lib/ringbuffer/ring_buffer_mmap.c
> index 35d30e7..1ca45a7 100644
> --- a/lib/ringbuffer/ring_buffer_mmap.c
> +++ b/lib/ringbuffer/ring_buffer_mmap.c
> @@ -32,8 +32,14 @@
> /*
>  * fault() vm_op implementation for ring buffer file mapping.
>  */
> +#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;
> +#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)
> {
> +#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */

Same here, ifdefs should contain entire functions.

Thanks,

Mathieu

>   struct lib_ring_buffer *buf = vma->vm_private_data;
>   struct channel *chan = buf->backend.chan;
>   const struct lib_ring_buffer_config *config = >backend.config;
> --
> 2.7.4

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev


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

2017-03-07 Thread Francis Deslauriers
Signed-off-by: Francis Deslauriers 
---
 lib/ringbuffer/ring_buffer_mmap.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/lib/ringbuffer/ring_buffer_mmap.c 
b/lib/ringbuffer/ring_buffer_mmap.c
index 35d30e7..1ca45a7 100644
--- a/lib/ringbuffer/ring_buffer_mmap.c
+++ b/lib/ringbuffer/ring_buffer_mmap.c
@@ -32,8 +32,14 @@
 /*
  * fault() vm_op implementation for ring buffer file mapping.
  */
+#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;
+#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)
 {
+#endif /* #else #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0)) */
struct lib_ring_buffer *buf = vma->vm_private_data;
struct channel *chan = buf->backend.chan;
const struct lib_ring_buffer_config *config = >backend.config;
-- 
2.7.4

___
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev