projects
/
lttng-modules.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: mm: introduce vma->vm_flags wrapper functions (v6.3)
[lttng-modules.git]
/
src
/
lib
/
ringbuffer
/
ring_buffer_mmap.c
diff --git
a/src/lib/ringbuffer/ring_buffer_mmap.c
b/src/lib/ringbuffer/ring_buffer_mmap.c
index 671119333c2f0c4e2dadb3de7f5e968775c2a5f2..d24b76a3c17be01c579791294250d2be55e7b39c 100644
(file)
--- a/
src/lib/ringbuffer/ring_buffer_mmap.c
+++ b/
src/lib/ringbuffer/ring_buffer_mmap.c
@@
-17,18
+17,21
@@
#include <ringbuffer/frontend.h>
#include <ringbuffer/vfs.h>
#include <ringbuffer/frontend.h>
#include <ringbuffer/vfs.h>
+#include <wrapper/mm.h>
+
/*
* fault() vm_op implementation for ring buffer file mapping.
*/
/*
* 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
{
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 l
ib
_ring_buffer *buf = vma->vm_private_data;
- struct channel *chan = buf->backend.chan;
- const struct l
ib
_ring_buffer_config *config = &chan->backend.config;
+ struct l
ttng_kernel
_ring_buffer *buf = vma->vm_private_data;
+ struct
lttng_kernel_ring_buffer_
channel *chan = buf->backend.chan;
+ const struct l
ttng_kernel
_ring_buffer_config *config = &chan->backend.config;
pgoff_t pgoff = vmf->pgoff;
unsigned long *pfnp;
void **virt;
pgoff_t pgoff = vmf->pgoff;
unsigned long *pfnp;
void **virt;
@@
-57,7
+60,8
@@
static int lib_ring_buffer_fault_compat(struct vm_area_struct *vma, struct vm_fa
return 0;
}
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;
static vm_fault_t lib_ring_buffer_fault(struct vm_fault *vmf)
{
struct vm_area_struct *vma = vmf->vma;
@@
-92,12
+96,12
@@
static const struct vm_operations_struct lib_ring_buffer_mmap_ops = {
*
* Caller should already have grabbed mmap_sem.
*/
*
* Caller should already have grabbed mmap_sem.
*/
-static int lib_ring_buffer_mmap_buf(struct l
ib
_ring_buffer *buf,
+static int lib_ring_buffer_mmap_buf(struct l
ttng_kernel
_ring_buffer *buf,
struct vm_area_struct *vma)
{
unsigned long length = vma->vm_end - vma->vm_start;
struct vm_area_struct *vma)
{
unsigned long length = vma->vm_end - vma->vm_start;
- struct channel *chan = buf->backend.chan;
- const struct l
ib
_ring_buffer_config *config = &chan->backend.config;
+ struct
lttng_kernel_ring_buffer_
channel *chan = buf->backend.chan;
+ const struct l
ttng_kernel
_ring_buffer_config *config = &chan->backend.config;
unsigned long mmap_buf_len;
if (config->output != RING_BUFFER_MMAP)
unsigned long mmap_buf_len;
if (config->output != RING_BUFFER_MMAP)
@@
-111,14
+115,14
@@
static int lib_ring_buffer_mmap_buf(struct lib_ring_buffer *buf,
return -EINVAL;
vma->vm_ops = &lib_ring_buffer_mmap_ops;
return -EINVAL;
vma->vm_ops = &lib_ring_buffer_mmap_ops;
-
vma->vm_flags |= VM_DONTEXPAND
;
+
wrapper_vm_flags_set(vma, VM_DONTEXPAND)
;
vma->vm_private_data = buf;
return 0;
}
int lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma,
vma->vm_private_data = buf;
return 0;
}
int lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma,
- struct l
ib
_ring_buffer *buf)
+ struct l
ttng_kernel
_ring_buffer *buf)
{
return lib_ring_buffer_mmap_buf(buf, vma);
}
{
return lib_ring_buffer_mmap_buf(buf, vma);
}
@@
-133,7
+137,7
@@
EXPORT_SYMBOL_GPL(lib_ring_buffer_mmap);
*/
int vfs_lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma)
{
*/
int vfs_lib_ring_buffer_mmap(struct file *filp, struct vm_area_struct *vma)
{
- struct l
ib
_ring_buffer *buf = filp->private_data;
+ struct l
ttng_kernel
_ring_buffer *buf = filp->private_data;
return lib_ring_buffer_mmap(filp, vma, buf);
}
EXPORT_SYMBOL_GPL(vfs_lib_ring_buffer_mmap);
return lib_ring_buffer_mmap(filp, vma, buf);
}
EXPORT_SYMBOL_GPL(vfs_lib_ring_buffer_mmap);
This page took
0.025553 seconds
and
4
git commands to generate.