Use the vm_flags wrapper since kernel version 6.3 25/306225/1 accepted/tizen/unified/20240219.160440 accepted/tizen/unified/x/20240220.145945
authorJaehoon Chung <jh80.chung@samsung.com>
Mon, 19 Feb 2024 03:57:24 +0000 (12:57 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 19 Feb 2024 04:35:19 +0000 (13:35 +0900)
Use the vm_flags wrapper since kernel version 6.3.

Change-Id: Icc3eada1fe80b57da47939fd449297977716d867
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
kernel/kdbus/pool.c
kernel/zlogger/zlogger.c

index 57981534c145ab950f1a5904af96ab6cda6974ad..565f9d0b97e4ef35de9a81ec7d4b2b7eb65bb8d5 100644 (file)
@@ -27,6 +27,7 @@
 #include <linux/slab.h>
 #include <linux/uaccess.h>
 #include <linux/uio.h>
+#include <linux/version.h>
 
 #include "pool.h"
 #include "util.h"
@@ -705,7 +706,11 @@ int kdbus_pool_mmap(const struct kdbus_pool *pool, struct vm_area_struct *vma)
        /* 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)
index 804e6f6b18688989eb75285cf9f5897942036997..d78498bbb39a546f5d967e77fc87bb9856dc2709 100644 (file)
@@ -547,7 +547,11 @@ static int zlogger_mmap(struct file *filp, struct vm_area_struct *vma)
 
        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);