X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Flib%2Fringbuffer%2Fring_buffer_mmap.c;h=25e2d8d5e60d9923ad9edf757914fbb8d6242e34;hb=05355f0bf8b4292ab7b8dc93571a568833b0a3c2;hp=671119333c2f0c4e2dadb3de7f5e968775c2a5f2;hpb=5f4c791e2ad2c814101ccdb500e65543f2792c41;p=lttng-modules.git diff --git a/src/lib/ringbuffer/ring_buffer_mmap.c b/src/lib/ringbuffer/ring_buffer_mmap.c index 67111933..25e2d8d5 100644 --- a/src/lib/ringbuffer/ring_buffer_mmap.c +++ b/src/lib/ringbuffer/ring_buffer_mmap.c @@ -20,15 +20,16 @@ /* * fault() vm_op implementation for ring buffer file mapping. */ -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,193,0,0, 4,19,0,0,0,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; - const struct lib_ring_buffer_config *config = &chan->backend.config; + struct lttng_kernel_ring_buffer *buf = vma->vm_private_data; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; + const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config; pgoff_t pgoff = vmf->pgoff; unsigned long *pfnp; void **virt; @@ -57,7 +58,8 @@ static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fa return 0; } -#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0)) +#if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,1,0) || \ + LTTNG_RHEL_KERNEL_RANGE(4,18,0,193,0,0, 4,19,0,0,0,0)) static vm_fault_t lib_ring_buffer_fault(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma; @@ -92,12 +94,12 @@ static const struct vm_operations_struct lib_ring_buffer_mmap_ops = { * * Caller should already have grabbed mmap_sem. */ -static int lib_ring_buffer_mmap_buf(struct lib_ring_buffer *buf, +static int lib_ring_buffer_mmap_buf(struct lttng_kernel_ring_buffer *buf, struct vm_area_struct *vma) { unsigned long length = vma->vm_end - vma->vm_start; - struct channel *chan = buf->backend.chan; - const struct lib_ring_buffer_config *config = &chan->backend.config; + struct lttng_kernel_ring_buffer_channel *chan = buf->backend.chan; + const struct lttng_kernel_ring_buffer_config *config = &chan->backend.config; unsigned long mmap_buf_len; if (config->output != RING_BUFFER_MMAP) @@ -118,7 +120,7 @@ static int lib_ring_buffer_mmap_buf(struct lib_ring_buffer *buf, } int lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma, - struct lib_ring_buffer *buf) + struct lttng_kernel_ring_buffer *buf) { return lib_ring_buffer_mmap_buf(buf, vma); } @@ -133,7 +135,7 @@ EXPORT_SYMBOL_GPL(lib_ring_buffer_mmap); */ int vfs_lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma) { - struct lib_ring_buffer *buf = filp->private_data; + struct lttng_kernel_ring_buffer *buf = filp->private_data; return lib_ring_buffer_mmap(filp, vma, buf); } EXPORT_SYMBOL_GPL(vfs_lib_ring_buffer_mmap);