1*a1f0dacaSLorenzo Stoakes /* SPDX-License-Identifier: GPL-2.0+ */
2*a1f0dacaSLorenzo Stoakes
3*a1f0dacaSLorenzo Stoakes #pragma once
4*a1f0dacaSLorenzo Stoakes
5*a1f0dacaSLorenzo Stoakes /*
6*a1f0dacaSLorenzo Stoakes * Contains declarations that are STUBBED, that is that are rendered no-ops, in
7*a1f0dacaSLorenzo Stoakes * order to faciliate userland VMA testing.
8*a1f0dacaSLorenzo Stoakes */
9*a1f0dacaSLorenzo Stoakes
10*a1f0dacaSLorenzo Stoakes /* Forward declarations. */
11*a1f0dacaSLorenzo Stoakes struct mm_struct;
12*a1f0dacaSLorenzo Stoakes struct vm_area_struct;
13*a1f0dacaSLorenzo Stoakes struct vm_area_desc;
14*a1f0dacaSLorenzo Stoakes struct pagetable_move_control;
15*a1f0dacaSLorenzo Stoakes struct mmap_action;
16*a1f0dacaSLorenzo Stoakes struct file;
17*a1f0dacaSLorenzo Stoakes struct anon_vma;
18*a1f0dacaSLorenzo Stoakes struct anon_vma_chain;
19*a1f0dacaSLorenzo Stoakes struct address_space;
20*a1f0dacaSLorenzo Stoakes struct unmap_desc;
21*a1f0dacaSLorenzo Stoakes
22*a1f0dacaSLorenzo Stoakes #define __bitwise
23*a1f0dacaSLorenzo Stoakes #define __randomize_layout
24*a1f0dacaSLorenzo Stoakes
25*a1f0dacaSLorenzo Stoakes #define FIRST_USER_ADDRESS 0UL
26*a1f0dacaSLorenzo Stoakes #define USER_PGTABLES_CEILING 0UL
27*a1f0dacaSLorenzo Stoakes
28*a1f0dacaSLorenzo Stoakes #define vma_policy(vma) NULL
29*a1f0dacaSLorenzo Stoakes
30*a1f0dacaSLorenzo Stoakes #define down_write_nest_lock(sem, nest_lock)
31*a1f0dacaSLorenzo Stoakes
32*a1f0dacaSLorenzo Stoakes #define data_race(expr) expr
33*a1f0dacaSLorenzo Stoakes
34*a1f0dacaSLorenzo Stoakes #define ASSERT_EXCLUSIVE_WRITER(x)
35*a1f0dacaSLorenzo Stoakes
36*a1f0dacaSLorenzo Stoakes struct vm_userfaultfd_ctx {};
37*a1f0dacaSLorenzo Stoakes struct mempolicy {};
38*a1f0dacaSLorenzo Stoakes struct mmu_gather {};
39*a1f0dacaSLorenzo Stoakes struct mutex {};
40*a1f0dacaSLorenzo Stoakes struct vm_fault {};
41*a1f0dacaSLorenzo Stoakes
userfaultfd_unmap_complete(struct mm_struct * mm,struct list_head * uf)42*a1f0dacaSLorenzo Stoakes static inline void userfaultfd_unmap_complete(struct mm_struct *mm,
43*a1f0dacaSLorenzo Stoakes struct list_head *uf)
44*a1f0dacaSLorenzo Stoakes {
45*a1f0dacaSLorenzo Stoakes }
46*a1f0dacaSLorenzo Stoakes
move_page_tables(struct pagetable_move_control * pmc)47*a1f0dacaSLorenzo Stoakes static inline unsigned long move_page_tables(struct pagetable_move_control *pmc)
48*a1f0dacaSLorenzo Stoakes {
49*a1f0dacaSLorenzo Stoakes return 0;
50*a1f0dacaSLorenzo Stoakes }
51*a1f0dacaSLorenzo Stoakes
free_pgd_range(struct mmu_gather * tlb,unsigned long addr,unsigned long end,unsigned long floor,unsigned long ceiling)52*a1f0dacaSLorenzo Stoakes static inline void free_pgd_range(struct mmu_gather *tlb,
53*a1f0dacaSLorenzo Stoakes unsigned long addr, unsigned long end,
54*a1f0dacaSLorenzo Stoakes unsigned long floor, unsigned long ceiling)
55*a1f0dacaSLorenzo Stoakes {
56*a1f0dacaSLorenzo Stoakes }
57*a1f0dacaSLorenzo Stoakes
ksm_execve(struct mm_struct * mm)58*a1f0dacaSLorenzo Stoakes static inline int ksm_execve(struct mm_struct *mm)
59*a1f0dacaSLorenzo Stoakes {
60*a1f0dacaSLorenzo Stoakes return 0;
61*a1f0dacaSLorenzo Stoakes }
62*a1f0dacaSLorenzo Stoakes
ksm_exit(struct mm_struct * mm)63*a1f0dacaSLorenzo Stoakes static inline void ksm_exit(struct mm_struct *mm)
64*a1f0dacaSLorenzo Stoakes {
65*a1f0dacaSLorenzo Stoakes }
66*a1f0dacaSLorenzo Stoakes
vma_numab_state_init(struct vm_area_struct * vma)67*a1f0dacaSLorenzo Stoakes static inline void vma_numab_state_init(struct vm_area_struct *vma)
68*a1f0dacaSLorenzo Stoakes {
69*a1f0dacaSLorenzo Stoakes }
70*a1f0dacaSLorenzo Stoakes
vma_numab_state_free(struct vm_area_struct * vma)71*a1f0dacaSLorenzo Stoakes static inline void vma_numab_state_free(struct vm_area_struct *vma)
72*a1f0dacaSLorenzo Stoakes {
73*a1f0dacaSLorenzo Stoakes }
74*a1f0dacaSLorenzo Stoakes
dup_anon_vma_name(struct vm_area_struct * orig_vma,struct vm_area_struct * new_vma)75*a1f0dacaSLorenzo Stoakes static inline void dup_anon_vma_name(struct vm_area_struct *orig_vma,
76*a1f0dacaSLorenzo Stoakes struct vm_area_struct *new_vma)
77*a1f0dacaSLorenzo Stoakes {
78*a1f0dacaSLorenzo Stoakes }
79*a1f0dacaSLorenzo Stoakes
free_anon_vma_name(struct vm_area_struct * vma)80*a1f0dacaSLorenzo Stoakes static inline void free_anon_vma_name(struct vm_area_struct *vma)
81*a1f0dacaSLorenzo Stoakes {
82*a1f0dacaSLorenzo Stoakes }
83*a1f0dacaSLorenzo Stoakes
mmap_action_prepare(struct mmap_action * action,struct vm_area_desc * desc)84*a1f0dacaSLorenzo Stoakes static inline void mmap_action_prepare(struct mmap_action *action,
85*a1f0dacaSLorenzo Stoakes struct vm_area_desc *desc)
86*a1f0dacaSLorenzo Stoakes {
87*a1f0dacaSLorenzo Stoakes }
88*a1f0dacaSLorenzo Stoakes
mmap_action_complete(struct mmap_action * action,struct vm_area_struct * vma)89*a1f0dacaSLorenzo Stoakes static inline int mmap_action_complete(struct mmap_action *action,
90*a1f0dacaSLorenzo Stoakes struct vm_area_struct *vma)
91*a1f0dacaSLorenzo Stoakes {
92*a1f0dacaSLorenzo Stoakes return 0;
93*a1f0dacaSLorenzo Stoakes }
94*a1f0dacaSLorenzo Stoakes
fixup_hugetlb_reservations(struct vm_area_struct * vma)95*a1f0dacaSLorenzo Stoakes static inline void fixup_hugetlb_reservations(struct vm_area_struct *vma)
96*a1f0dacaSLorenzo Stoakes {
97*a1f0dacaSLorenzo Stoakes }
98*a1f0dacaSLorenzo Stoakes
shmem_file(struct file * file)99*a1f0dacaSLorenzo Stoakes static inline bool shmem_file(struct file *file)
100*a1f0dacaSLorenzo Stoakes {
101*a1f0dacaSLorenzo Stoakes return false;
102*a1f0dacaSLorenzo Stoakes }
103*a1f0dacaSLorenzo Stoakes
ksm_vma_flags(const struct mm_struct * mm,const struct file * file,vm_flags_t vm_flags)104*a1f0dacaSLorenzo Stoakes static inline vm_flags_t ksm_vma_flags(const struct mm_struct *mm,
105*a1f0dacaSLorenzo Stoakes const struct file *file, vm_flags_t vm_flags)
106*a1f0dacaSLorenzo Stoakes {
107*a1f0dacaSLorenzo Stoakes return vm_flags;
108*a1f0dacaSLorenzo Stoakes }
109*a1f0dacaSLorenzo Stoakes
remap_pfn_range_prepare(struct vm_area_desc * desc,unsigned long pfn)110*a1f0dacaSLorenzo Stoakes static inline void remap_pfn_range_prepare(struct vm_area_desc *desc, unsigned long pfn)
111*a1f0dacaSLorenzo Stoakes {
112*a1f0dacaSLorenzo Stoakes }
113*a1f0dacaSLorenzo Stoakes
remap_pfn_range_complete(struct vm_area_struct * vma,unsigned long addr,unsigned long pfn,unsigned long size,pgprot_t pgprot)114*a1f0dacaSLorenzo Stoakes static inline int remap_pfn_range_complete(struct vm_area_struct *vma, unsigned long addr,
115*a1f0dacaSLorenzo Stoakes unsigned long pfn, unsigned long size, pgprot_t pgprot)
116*a1f0dacaSLorenzo Stoakes {
117*a1f0dacaSLorenzo Stoakes return 0;
118*a1f0dacaSLorenzo Stoakes }
119*a1f0dacaSLorenzo Stoakes
do_munmap(struct mm_struct *,unsigned long,size_t,struct list_head * uf)120*a1f0dacaSLorenzo Stoakes static inline int do_munmap(struct mm_struct *, unsigned long, size_t,
121*a1f0dacaSLorenzo Stoakes struct list_head *uf)
122*a1f0dacaSLorenzo Stoakes {
123*a1f0dacaSLorenzo Stoakes return 0;
124*a1f0dacaSLorenzo Stoakes }
125*a1f0dacaSLorenzo Stoakes
126*a1f0dacaSLorenzo Stoakes /* Currently stubbed but we may later wish to un-stub. */
127*a1f0dacaSLorenzo Stoakes static inline void vm_acct_memory(long pages);
128*a1f0dacaSLorenzo Stoakes
mmap_assert_locked(struct mm_struct * mm)129*a1f0dacaSLorenzo Stoakes static inline void mmap_assert_locked(struct mm_struct *mm)
130*a1f0dacaSLorenzo Stoakes {
131*a1f0dacaSLorenzo Stoakes }
132*a1f0dacaSLorenzo Stoakes
133*a1f0dacaSLorenzo Stoakes
anon_vma_unlock_write(struct anon_vma * anon_vma)134*a1f0dacaSLorenzo Stoakes static inline void anon_vma_unlock_write(struct anon_vma *anon_vma)
135*a1f0dacaSLorenzo Stoakes {
136*a1f0dacaSLorenzo Stoakes }
137*a1f0dacaSLorenzo Stoakes
i_mmap_unlock_write(struct address_space * mapping)138*a1f0dacaSLorenzo Stoakes static inline void i_mmap_unlock_write(struct address_space *mapping)
139*a1f0dacaSLorenzo Stoakes {
140*a1f0dacaSLorenzo Stoakes }
141*a1f0dacaSLorenzo Stoakes
userfaultfd_unmap_prep(struct vm_area_struct * vma,unsigned long start,unsigned long end,struct list_head * unmaps)142*a1f0dacaSLorenzo Stoakes static inline int userfaultfd_unmap_prep(struct vm_area_struct *vma,
143*a1f0dacaSLorenzo Stoakes unsigned long start,
144*a1f0dacaSLorenzo Stoakes unsigned long end,
145*a1f0dacaSLorenzo Stoakes struct list_head *unmaps)
146*a1f0dacaSLorenzo Stoakes {
147*a1f0dacaSLorenzo Stoakes return 0;
148*a1f0dacaSLorenzo Stoakes }
149*a1f0dacaSLorenzo Stoakes
mmap_write_downgrade(struct mm_struct * mm)150*a1f0dacaSLorenzo Stoakes static inline void mmap_write_downgrade(struct mm_struct *mm)
151*a1f0dacaSLorenzo Stoakes {
152*a1f0dacaSLorenzo Stoakes }
153*a1f0dacaSLorenzo Stoakes
mmap_read_unlock(struct mm_struct * mm)154*a1f0dacaSLorenzo Stoakes static inline void mmap_read_unlock(struct mm_struct *mm)
155*a1f0dacaSLorenzo Stoakes {
156*a1f0dacaSLorenzo Stoakes }
157*a1f0dacaSLorenzo Stoakes
mmap_write_unlock(struct mm_struct * mm)158*a1f0dacaSLorenzo Stoakes static inline void mmap_write_unlock(struct mm_struct *mm)
159*a1f0dacaSLorenzo Stoakes {
160*a1f0dacaSLorenzo Stoakes }
161*a1f0dacaSLorenzo Stoakes
mmap_write_lock_killable(struct mm_struct * mm)162*a1f0dacaSLorenzo Stoakes static inline int mmap_write_lock_killable(struct mm_struct *mm)
163*a1f0dacaSLorenzo Stoakes {
164*a1f0dacaSLorenzo Stoakes return 0;
165*a1f0dacaSLorenzo Stoakes }
166*a1f0dacaSLorenzo Stoakes
can_modify_mm(struct mm_struct * mm,unsigned long start,unsigned long end)167*a1f0dacaSLorenzo Stoakes static inline bool can_modify_mm(struct mm_struct *mm,
168*a1f0dacaSLorenzo Stoakes unsigned long start,
169*a1f0dacaSLorenzo Stoakes unsigned long end)
170*a1f0dacaSLorenzo Stoakes {
171*a1f0dacaSLorenzo Stoakes return true;
172*a1f0dacaSLorenzo Stoakes }
173*a1f0dacaSLorenzo Stoakes
arch_unmap(struct mm_struct * mm,unsigned long start,unsigned long end)174*a1f0dacaSLorenzo Stoakes static inline void arch_unmap(struct mm_struct *mm,
175*a1f0dacaSLorenzo Stoakes unsigned long start,
176*a1f0dacaSLorenzo Stoakes unsigned long end)
177*a1f0dacaSLorenzo Stoakes {
178*a1f0dacaSLorenzo Stoakes }
179*a1f0dacaSLorenzo Stoakes
mpol_equal(struct mempolicy * a,struct mempolicy * b)180*a1f0dacaSLorenzo Stoakes static inline bool mpol_equal(struct mempolicy *a, struct mempolicy *b)
181*a1f0dacaSLorenzo Stoakes {
182*a1f0dacaSLorenzo Stoakes return true;
183*a1f0dacaSLorenzo Stoakes }
184*a1f0dacaSLorenzo Stoakes
khugepaged_enter_vma(struct vm_area_struct * vma,vm_flags_t vm_flags)185*a1f0dacaSLorenzo Stoakes static inline void khugepaged_enter_vma(struct vm_area_struct *vma,
186*a1f0dacaSLorenzo Stoakes vm_flags_t vm_flags)
187*a1f0dacaSLorenzo Stoakes {
188*a1f0dacaSLorenzo Stoakes }
189*a1f0dacaSLorenzo Stoakes
mapping_can_writeback(struct address_space * mapping)190*a1f0dacaSLorenzo Stoakes static inline bool mapping_can_writeback(struct address_space *mapping)
191*a1f0dacaSLorenzo Stoakes {
192*a1f0dacaSLorenzo Stoakes return true;
193*a1f0dacaSLorenzo Stoakes }
194*a1f0dacaSLorenzo Stoakes
is_vm_hugetlb_page(struct vm_area_struct * vma)195*a1f0dacaSLorenzo Stoakes static inline bool is_vm_hugetlb_page(struct vm_area_struct *vma)
196*a1f0dacaSLorenzo Stoakes {
197*a1f0dacaSLorenzo Stoakes return false;
198*a1f0dacaSLorenzo Stoakes }
199*a1f0dacaSLorenzo Stoakes
vma_soft_dirty_enabled(struct vm_area_struct * vma)200*a1f0dacaSLorenzo Stoakes static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma)
201*a1f0dacaSLorenzo Stoakes {
202*a1f0dacaSLorenzo Stoakes return false;
203*a1f0dacaSLorenzo Stoakes }
204*a1f0dacaSLorenzo Stoakes
userfaultfd_wp(struct vm_area_struct * vma)205*a1f0dacaSLorenzo Stoakes static inline bool userfaultfd_wp(struct vm_area_struct *vma)
206*a1f0dacaSLorenzo Stoakes {
207*a1f0dacaSLorenzo Stoakes return false;
208*a1f0dacaSLorenzo Stoakes }
209*a1f0dacaSLorenzo Stoakes
mmap_assert_write_locked(struct mm_struct * mm)210*a1f0dacaSLorenzo Stoakes static inline void mmap_assert_write_locked(struct mm_struct *mm)
211*a1f0dacaSLorenzo Stoakes {
212*a1f0dacaSLorenzo Stoakes }
213*a1f0dacaSLorenzo Stoakes
mutex_lock(struct mutex * lock)214*a1f0dacaSLorenzo Stoakes static inline void mutex_lock(struct mutex *lock)
215*a1f0dacaSLorenzo Stoakes {
216*a1f0dacaSLorenzo Stoakes }
217*a1f0dacaSLorenzo Stoakes
mutex_unlock(struct mutex * lock)218*a1f0dacaSLorenzo Stoakes static inline void mutex_unlock(struct mutex *lock)
219*a1f0dacaSLorenzo Stoakes {
220*a1f0dacaSLorenzo Stoakes }
221*a1f0dacaSLorenzo Stoakes
mutex_is_locked(struct mutex * lock)222*a1f0dacaSLorenzo Stoakes static inline bool mutex_is_locked(struct mutex *lock)
223*a1f0dacaSLorenzo Stoakes {
224*a1f0dacaSLorenzo Stoakes return true;
225*a1f0dacaSLorenzo Stoakes }
226*a1f0dacaSLorenzo Stoakes
signal_pending(void * p)227*a1f0dacaSLorenzo Stoakes static inline bool signal_pending(void *p)
228*a1f0dacaSLorenzo Stoakes {
229*a1f0dacaSLorenzo Stoakes return false;
230*a1f0dacaSLorenzo Stoakes }
231*a1f0dacaSLorenzo Stoakes
is_file_hugepages(struct file * file)232*a1f0dacaSLorenzo Stoakes static inline bool is_file_hugepages(struct file *file)
233*a1f0dacaSLorenzo Stoakes {
234*a1f0dacaSLorenzo Stoakes return false;
235*a1f0dacaSLorenzo Stoakes }
236*a1f0dacaSLorenzo Stoakes
security_vm_enough_memory_mm(struct mm_struct * mm,long pages)237*a1f0dacaSLorenzo Stoakes static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages)
238*a1f0dacaSLorenzo Stoakes {
239*a1f0dacaSLorenzo Stoakes return 0;
240*a1f0dacaSLorenzo Stoakes }
241*a1f0dacaSLorenzo Stoakes
may_expand_vm(struct mm_struct * mm,vm_flags_t flags,unsigned long npages)242*a1f0dacaSLorenzo Stoakes static inline bool may_expand_vm(struct mm_struct *mm, vm_flags_t flags,
243*a1f0dacaSLorenzo Stoakes unsigned long npages)
244*a1f0dacaSLorenzo Stoakes {
245*a1f0dacaSLorenzo Stoakes return true;
246*a1f0dacaSLorenzo Stoakes }
247*a1f0dacaSLorenzo Stoakes
shmem_zero_setup(struct vm_area_struct * vma)248*a1f0dacaSLorenzo Stoakes static inline int shmem_zero_setup(struct vm_area_struct *vma)
249*a1f0dacaSLorenzo Stoakes {
250*a1f0dacaSLorenzo Stoakes return 0;
251*a1f0dacaSLorenzo Stoakes }
252*a1f0dacaSLorenzo Stoakes
253*a1f0dacaSLorenzo Stoakes
vm_acct_memory(long pages)254*a1f0dacaSLorenzo Stoakes static inline void vm_acct_memory(long pages)
255*a1f0dacaSLorenzo Stoakes {
256*a1f0dacaSLorenzo Stoakes }
257*a1f0dacaSLorenzo Stoakes
vma_interval_tree_insert(struct vm_area_struct * vma,struct rb_root_cached * rb)258*a1f0dacaSLorenzo Stoakes static inline void vma_interval_tree_insert(struct vm_area_struct *vma,
259*a1f0dacaSLorenzo Stoakes struct rb_root_cached *rb)
260*a1f0dacaSLorenzo Stoakes {
261*a1f0dacaSLorenzo Stoakes }
262*a1f0dacaSLorenzo Stoakes
vma_interval_tree_remove(struct vm_area_struct * vma,struct rb_root_cached * rb)263*a1f0dacaSLorenzo Stoakes static inline void vma_interval_tree_remove(struct vm_area_struct *vma,
264*a1f0dacaSLorenzo Stoakes struct rb_root_cached *rb)
265*a1f0dacaSLorenzo Stoakes {
266*a1f0dacaSLorenzo Stoakes }
267*a1f0dacaSLorenzo Stoakes
flush_dcache_mmap_unlock(struct address_space * mapping)268*a1f0dacaSLorenzo Stoakes static inline void flush_dcache_mmap_unlock(struct address_space *mapping)
269*a1f0dacaSLorenzo Stoakes {
270*a1f0dacaSLorenzo Stoakes }
271*a1f0dacaSLorenzo Stoakes
anon_vma_interval_tree_insert(struct anon_vma_chain * avc,struct rb_root_cached * rb)272*a1f0dacaSLorenzo Stoakes static inline void anon_vma_interval_tree_insert(struct anon_vma_chain *avc,
273*a1f0dacaSLorenzo Stoakes struct rb_root_cached *rb)
274*a1f0dacaSLorenzo Stoakes {
275*a1f0dacaSLorenzo Stoakes }
276*a1f0dacaSLorenzo Stoakes
anon_vma_interval_tree_remove(struct anon_vma_chain * avc,struct rb_root_cached * rb)277*a1f0dacaSLorenzo Stoakes static inline void anon_vma_interval_tree_remove(struct anon_vma_chain *avc,
278*a1f0dacaSLorenzo Stoakes struct rb_root_cached *rb)
279*a1f0dacaSLorenzo Stoakes {
280*a1f0dacaSLorenzo Stoakes }
281*a1f0dacaSLorenzo Stoakes
uprobe_mmap(struct vm_area_struct * vma)282*a1f0dacaSLorenzo Stoakes static inline void uprobe_mmap(struct vm_area_struct *vma)
283*a1f0dacaSLorenzo Stoakes {
284*a1f0dacaSLorenzo Stoakes }
285*a1f0dacaSLorenzo Stoakes
uprobe_munmap(struct vm_area_struct * vma,unsigned long start,unsigned long end)286*a1f0dacaSLorenzo Stoakes static inline void uprobe_munmap(struct vm_area_struct *vma,
287*a1f0dacaSLorenzo Stoakes unsigned long start, unsigned long end)
288*a1f0dacaSLorenzo Stoakes {
289*a1f0dacaSLorenzo Stoakes }
290*a1f0dacaSLorenzo Stoakes
i_mmap_lock_write(struct address_space * mapping)291*a1f0dacaSLorenzo Stoakes static inline void i_mmap_lock_write(struct address_space *mapping)
292*a1f0dacaSLorenzo Stoakes {
293*a1f0dacaSLorenzo Stoakes }
294*a1f0dacaSLorenzo Stoakes
anon_vma_lock_write(struct anon_vma * anon_vma)295*a1f0dacaSLorenzo Stoakes static inline void anon_vma_lock_write(struct anon_vma *anon_vma)
296*a1f0dacaSLorenzo Stoakes {
297*a1f0dacaSLorenzo Stoakes }
298*a1f0dacaSLorenzo Stoakes
vma_assert_write_locked(struct vm_area_struct * vma)299*a1f0dacaSLorenzo Stoakes static inline void vma_assert_write_locked(struct vm_area_struct *vma)
300*a1f0dacaSLorenzo Stoakes {
301*a1f0dacaSLorenzo Stoakes }
302*a1f0dacaSLorenzo Stoakes
ksm_add_vma(struct vm_area_struct * vma)303*a1f0dacaSLorenzo Stoakes static inline void ksm_add_vma(struct vm_area_struct *vma)
304*a1f0dacaSLorenzo Stoakes {
305*a1f0dacaSLorenzo Stoakes }
306*a1f0dacaSLorenzo Stoakes
perf_event_mmap(struct vm_area_struct * vma)307*a1f0dacaSLorenzo Stoakes static inline void perf_event_mmap(struct vm_area_struct *vma)
308*a1f0dacaSLorenzo Stoakes {
309*a1f0dacaSLorenzo Stoakes }
310*a1f0dacaSLorenzo Stoakes
vma_is_dax(struct vm_area_struct * vma)311*a1f0dacaSLorenzo Stoakes static inline bool vma_is_dax(struct vm_area_struct *vma)
312*a1f0dacaSLorenzo Stoakes {
313*a1f0dacaSLorenzo Stoakes return false;
314*a1f0dacaSLorenzo Stoakes }
315*a1f0dacaSLorenzo Stoakes
get_gate_vma(struct mm_struct * mm)316*a1f0dacaSLorenzo Stoakes static inline struct vm_area_struct *get_gate_vma(struct mm_struct *mm)
317*a1f0dacaSLorenzo Stoakes {
318*a1f0dacaSLorenzo Stoakes return NULL;
319*a1f0dacaSLorenzo Stoakes }
320*a1f0dacaSLorenzo Stoakes
arch_validate_flags(vm_flags_t flags)321*a1f0dacaSLorenzo Stoakes static inline bool arch_validate_flags(vm_flags_t flags)
322*a1f0dacaSLorenzo Stoakes {
323*a1f0dacaSLorenzo Stoakes return true;
324*a1f0dacaSLorenzo Stoakes }
325*a1f0dacaSLorenzo Stoakes
vma_close(struct vm_area_struct * vma)326*a1f0dacaSLorenzo Stoakes static inline void vma_close(struct vm_area_struct *vma)
327*a1f0dacaSLorenzo Stoakes {
328*a1f0dacaSLorenzo Stoakes }
329*a1f0dacaSLorenzo Stoakes
mmap_file(struct file * file,struct vm_area_struct * vma)330*a1f0dacaSLorenzo Stoakes static inline int mmap_file(struct file *file, struct vm_area_struct *vma)
331*a1f0dacaSLorenzo Stoakes {
332*a1f0dacaSLorenzo Stoakes return 0;
333*a1f0dacaSLorenzo Stoakes }
334*a1f0dacaSLorenzo Stoakes
is_hugepage_only_range(struct mm_struct * mm,unsigned long addr,unsigned long len)335*a1f0dacaSLorenzo Stoakes static inline int is_hugepage_only_range(struct mm_struct *mm,
336*a1f0dacaSLorenzo Stoakes unsigned long addr, unsigned long len)
337*a1f0dacaSLorenzo Stoakes {
338*a1f0dacaSLorenzo Stoakes return 0;
339*a1f0dacaSLorenzo Stoakes }
340*a1f0dacaSLorenzo Stoakes
capable(int cap)341*a1f0dacaSLorenzo Stoakes static inline bool capable(int cap)
342*a1f0dacaSLorenzo Stoakes {
343*a1f0dacaSLorenzo Stoakes return true;
344*a1f0dacaSLorenzo Stoakes }
345*a1f0dacaSLorenzo Stoakes
anon_vma_name(struct vm_area_struct * vma)346*a1f0dacaSLorenzo Stoakes static inline struct anon_vma_name *anon_vma_name(struct vm_area_struct *vma)
347*a1f0dacaSLorenzo Stoakes {
348*a1f0dacaSLorenzo Stoakes return NULL;
349*a1f0dacaSLorenzo Stoakes }
350*a1f0dacaSLorenzo Stoakes
is_mergeable_vm_userfaultfd_ctx(struct vm_area_struct * vma,struct vm_userfaultfd_ctx vm_ctx)351*a1f0dacaSLorenzo Stoakes static inline bool is_mergeable_vm_userfaultfd_ctx(struct vm_area_struct *vma,
352*a1f0dacaSLorenzo Stoakes struct vm_userfaultfd_ctx vm_ctx)
353*a1f0dacaSLorenzo Stoakes {
354*a1f0dacaSLorenzo Stoakes return true;
355*a1f0dacaSLorenzo Stoakes }
356*a1f0dacaSLorenzo Stoakes
anon_vma_name_eq(struct anon_vma_name * anon_name1,struct anon_vma_name * anon_name2)357*a1f0dacaSLorenzo Stoakes static inline bool anon_vma_name_eq(struct anon_vma_name *anon_name1,
358*a1f0dacaSLorenzo Stoakes struct anon_vma_name *anon_name2)
359*a1f0dacaSLorenzo Stoakes {
360*a1f0dacaSLorenzo Stoakes return true;
361*a1f0dacaSLorenzo Stoakes }
362*a1f0dacaSLorenzo Stoakes
might_sleep(void)363*a1f0dacaSLorenzo Stoakes static inline void might_sleep(void)
364*a1f0dacaSLorenzo Stoakes {
365*a1f0dacaSLorenzo Stoakes }
366*a1f0dacaSLorenzo Stoakes
fput(struct file * file)367*a1f0dacaSLorenzo Stoakes static inline void fput(struct file *file)
368*a1f0dacaSLorenzo Stoakes {
369*a1f0dacaSLorenzo Stoakes }
370*a1f0dacaSLorenzo Stoakes
mpol_put(struct mempolicy * pol)371*a1f0dacaSLorenzo Stoakes static inline void mpol_put(struct mempolicy *pol)
372*a1f0dacaSLorenzo Stoakes {
373*a1f0dacaSLorenzo Stoakes }
374*a1f0dacaSLorenzo Stoakes
lru_add_drain(void)375*a1f0dacaSLorenzo Stoakes static inline void lru_add_drain(void)
376*a1f0dacaSLorenzo Stoakes {
377*a1f0dacaSLorenzo Stoakes }
378*a1f0dacaSLorenzo Stoakes
tlb_gather_mmu(struct mmu_gather * tlb,struct mm_struct * mm)379*a1f0dacaSLorenzo Stoakes static inline void tlb_gather_mmu(struct mmu_gather *tlb, struct mm_struct *mm)
380*a1f0dacaSLorenzo Stoakes {
381*a1f0dacaSLorenzo Stoakes }
382*a1f0dacaSLorenzo Stoakes
update_hiwater_rss(struct mm_struct * mm)383*a1f0dacaSLorenzo Stoakes static inline void update_hiwater_rss(struct mm_struct *mm)
384*a1f0dacaSLorenzo Stoakes {
385*a1f0dacaSLorenzo Stoakes }
386*a1f0dacaSLorenzo Stoakes
update_hiwater_vm(struct mm_struct * mm)387*a1f0dacaSLorenzo Stoakes static inline void update_hiwater_vm(struct mm_struct *mm)
388*a1f0dacaSLorenzo Stoakes {
389*a1f0dacaSLorenzo Stoakes }
390*a1f0dacaSLorenzo Stoakes
unmap_vmas(struct mmu_gather * tlb,struct unmap_desc * unmap)391*a1f0dacaSLorenzo Stoakes static inline void unmap_vmas(struct mmu_gather *tlb, struct unmap_desc *unmap)
392*a1f0dacaSLorenzo Stoakes {
393*a1f0dacaSLorenzo Stoakes }
394*a1f0dacaSLorenzo Stoakes
free_pgtables(struct mmu_gather * tlb,struct unmap_desc * unmap)395*a1f0dacaSLorenzo Stoakes static inline void free_pgtables(struct mmu_gather *tlb, struct unmap_desc *unmap)
396*a1f0dacaSLorenzo Stoakes {
397*a1f0dacaSLorenzo Stoakes }
398*a1f0dacaSLorenzo Stoakes
mapping_unmap_writable(struct address_space * mapping)399*a1f0dacaSLorenzo Stoakes static inline void mapping_unmap_writable(struct address_space *mapping)
400*a1f0dacaSLorenzo Stoakes {
401*a1f0dacaSLorenzo Stoakes }
402*a1f0dacaSLorenzo Stoakes
flush_dcache_mmap_lock(struct address_space * mapping)403*a1f0dacaSLorenzo Stoakes static inline void flush_dcache_mmap_lock(struct address_space *mapping)
404*a1f0dacaSLorenzo Stoakes {
405*a1f0dacaSLorenzo Stoakes }
406*a1f0dacaSLorenzo Stoakes
tlb_finish_mmu(struct mmu_gather * tlb)407*a1f0dacaSLorenzo Stoakes static inline void tlb_finish_mmu(struct mmu_gather *tlb)
408*a1f0dacaSLorenzo Stoakes {
409*a1f0dacaSLorenzo Stoakes }
410*a1f0dacaSLorenzo Stoakes
get_file(struct file * f)411*a1f0dacaSLorenzo Stoakes static inline struct file *get_file(struct file *f)
412*a1f0dacaSLorenzo Stoakes {
413*a1f0dacaSLorenzo Stoakes return f;
414*a1f0dacaSLorenzo Stoakes }
415*a1f0dacaSLorenzo Stoakes
vma_dup_policy(struct vm_area_struct * src,struct vm_area_struct * dst)416*a1f0dacaSLorenzo Stoakes static inline int vma_dup_policy(struct vm_area_struct *src, struct vm_area_struct *dst)
417*a1f0dacaSLorenzo Stoakes {
418*a1f0dacaSLorenzo Stoakes return 0;
419*a1f0dacaSLorenzo Stoakes }
420*a1f0dacaSLorenzo Stoakes
vma_adjust_trans_huge(struct vm_area_struct * vma,unsigned long start,unsigned long end,struct vm_area_struct * next)421*a1f0dacaSLorenzo Stoakes static inline void vma_adjust_trans_huge(struct vm_area_struct *vma,
422*a1f0dacaSLorenzo Stoakes unsigned long start,
423*a1f0dacaSLorenzo Stoakes unsigned long end,
424*a1f0dacaSLorenzo Stoakes struct vm_area_struct *next)
425*a1f0dacaSLorenzo Stoakes {
426*a1f0dacaSLorenzo Stoakes }
427*a1f0dacaSLorenzo Stoakes
hugetlb_split(struct vm_area_struct *,unsigned long)428*a1f0dacaSLorenzo Stoakes static inline void hugetlb_split(struct vm_area_struct *, unsigned long) {}
429