blob: 6fce268a4588e5a064214b84309f4520f8759d65 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Davidlohr Bueso615d6e82014-04-07 15:37:25 -07002#ifndef __LINUX_VMACACHE_H
3#define __LINUX_VMACACHE_H
4
5#include <linux/sched.h>
6#include <linux/mm.h>
7
Davidlohr Bueso615d6e82014-04-07 15:37:25 -07008static inline void vmacache_flush(struct task_struct *tsk)
9{
Ingo Molnar314ff782017-02-03 11:03:31 +010010 memset(tsk->vmacache.vmas, 0, sizeof(tsk->vmacache.vmas));
Davidlohr Bueso615d6e82014-04-07 15:37:25 -070011}
12
Davidlohr Bueso615d6e82014-04-07 15:37:25 -070013extern void vmacache_update(unsigned long addr, struct vm_area_struct *newvma);
14extern struct vm_area_struct *vmacache_find(struct mm_struct *mm,
15 unsigned long addr);
16
17#ifndef CONFIG_MMU
18extern struct vm_area_struct *vmacache_find_exact(struct mm_struct *mm,
19 unsigned long start,
20 unsigned long end);
21#endif
22
23static inline void vmacache_invalidate(struct mm_struct *mm)
24{
25 mm->vmacache_seqnum++;
Davidlohr Bueso615d6e82014-04-07 15:37:25 -070026}
27
28#endif /* __LINUX_VMACACHE_H */