Skip to content

Commit

Permalink
version_compat_defs: Add vm_flags_set()/vm_flags_clear()
Browse files Browse the repository at this point in the history
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I8812670a600bdc9cf13ce0d89893a71a5d971e43
(cherry picked from commit 9ced5e9)
Signed-off-by: Joshua Riek <jjriek@verizon.net>
  • Loading branch information
rkhuangtao authored and amazingfate committed Mar 18, 2024
1 parent ad74c2e commit f3fb30a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions include/linux/version_compat_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,17 @@ typedef unsigned int __poll_t;
#endif /* CONFIG_MMU */
#endif /* KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE */

#include <linux/mm.h>
#if !((KERNEL_VERSION(6, 3, 0) <= LINUX_VERSION_CODE) || \
((KERNEL_VERSION(6, 1, 25) <= LINUX_VERSION_CODE) && defined(__ANDROID_COMMON_KERNEL__)))
static inline void vm_flags_set(struct vm_area_struct *vma, vm_flags_t flags)
{
vma->vm_flags |= flags;
}
static inline void vm_flags_clear(struct vm_area_struct *vma, vm_flags_t flags)
{
vma->vm_flags &= ~flags;
}
#endif

#endif /* _VERSION_COMPAT_DEFS_H_ */

0 comments on commit f3fb30a

Please sign in to comment.