Merge tag 'kbuild-v4.19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[linux-2.6-microblaze.git] / include / linux / vmacache.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __LINUX_VMACACHE_H
3 #define __LINUX_VMACACHE_H
4
5 #include <linux/sched.h>
6 #include <linux/mm.h>
7
8 static inline void vmacache_flush(struct task_struct *tsk)
9 {
10         memset(tsk->vmacache.vmas, 0, sizeof(tsk->vmacache.vmas));
11 }
12
13 extern void vmacache_flush_all(struct mm_struct *mm);
14 extern void vmacache_update(unsigned long addr, struct vm_area_struct *newvma);
15 extern struct vm_area_struct *vmacache_find(struct mm_struct *mm,
16                                                     unsigned long addr);
17
18 #ifndef CONFIG_MMU
19 extern struct vm_area_struct *vmacache_find_exact(struct mm_struct *mm,
20                                                   unsigned long start,
21                                                   unsigned long end);
22 #endif
23
24 static inline void vmacache_invalidate(struct mm_struct *mm)
25 {
26         mm->vmacache_seqnum++;
27
28         /* deal with overflows */
29         if (unlikely(mm->vmacache_seqnum == 0))
30                 vmacache_flush_all(mm);
31 }
32
33 #endif /* __LINUX_VMACACHE_H */