Use the vm_flags wrapper since kernel version 6.3.
Change-Id: Icc3eada1fe80b57da47939fd449297977716d867
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/uio.h>
+#include <linux/version.h>
#include "pool.h"
#include "util.h"
/* deny write access to the pool */
if (vma->vm_flags & VM_WRITE)
return -EPERM;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0))
+ vm_flags_clear(vma, VM_MAYWRITE);
+#else
vma->vm_flags &= ~VM_MAYWRITE;
+#endif
/* do not allow to map more than the size of the file */
if ((vma->vm_end - vma->vm_start) > pool->size)
ptr->vma = vma;
vma->vm_private_data = ptr;
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,3,0))
+ vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | VM_DONTCOPY);
+#else
vma->vm_flags |= VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP | VM_DONTCOPY;
+#endif
vma->vm_ops = &zlogger_vm_ops;
page = virt_to_page((unsigned long)p);