@@ -115,6 +115,12 @@ struct file_region {
115
115
#endif
116
116
};
117
117
118
+ struct hugetlb_vma_lock {
119
+ struct kref refs ;
120
+ struct rw_semaphore rw_sema ;
121
+ struct vm_area_struct * vma ;
122
+ };
123
+
118
124
extern struct resv_map * resv_map_alloc (void );
119
125
void resv_map_release (struct kref * ref );
120
126
@@ -127,7 +133,7 @@ struct hugepage_subpool *hugepage_new_subpool(struct hstate *h, long max_hpages,
127
133
long min_hpages );
128
134
void hugepage_put_subpool (struct hugepage_subpool * spool );
129
135
130
- void reset_vma_resv_huge_pages (struct vm_area_struct * vma );
136
+ void hugetlb_dup_vma_private (struct vm_area_struct * vma );
131
137
void clear_vma_resv_huge_pages (struct vm_area_struct * vma );
132
138
int hugetlb_sysctl_handler (struct ctl_table * , int , void * , size_t * , loff_t * );
133
139
int hugetlb_overcommit_handler (struct ctl_table * , int , void * , size_t * ,
@@ -215,6 +221,14 @@ struct page *follow_huge_pud(struct mm_struct *mm, unsigned long address,
215
221
struct page * follow_huge_pgd (struct mm_struct * mm , unsigned long address ,
216
222
pgd_t * pgd , int flags );
217
223
224
+ void hugetlb_vma_lock_read (struct vm_area_struct * vma );
225
+ void hugetlb_vma_unlock_read (struct vm_area_struct * vma );
226
+ void hugetlb_vma_lock_write (struct vm_area_struct * vma );
227
+ void hugetlb_vma_unlock_write (struct vm_area_struct * vma );
228
+ int hugetlb_vma_trylock_write (struct vm_area_struct * vma );
229
+ void hugetlb_vma_assert_locked (struct vm_area_struct * vma );
230
+ void hugetlb_vma_lock_release (struct kref * kref );
231
+
218
232
int pmd_huge (pmd_t pmd );
219
233
int pud_huge (pud_t pud );
220
234
unsigned long hugetlb_change_protection (struct vm_area_struct * vma ,
@@ -226,7 +240,7 @@ void hugetlb_unshare_all_pmds(struct vm_area_struct *vma);
226
240
227
241
#else /* !CONFIG_HUGETLB_PAGE */
228
242
229
- static inline void reset_vma_resv_huge_pages (struct vm_area_struct * vma )
243
+ static inline void hugetlb_dup_vma_private (struct vm_area_struct * vma )
230
244
{
231
245
}
232
246
@@ -337,6 +351,31 @@ static inline int prepare_hugepage_range(struct file *file,
337
351
return - EINVAL ;
338
352
}
339
353
354
+ static inline void hugetlb_vma_lock_read (struct vm_area_struct * vma )
355
+ {
356
+ }
357
+
358
+ static inline void hugetlb_vma_unlock_read (struct vm_area_struct * vma )
359
+ {
360
+ }
361
+
362
+ static inline void hugetlb_vma_lock_write (struct vm_area_struct * vma )
363
+ {
364
+ }
365
+
366
+ static inline void hugetlb_vma_unlock_write (struct vm_area_struct * vma )
367
+ {
368
+ }
369
+
370
+ static inline int hugetlb_vma_trylock_write (struct vm_area_struct * vma )
371
+ {
372
+ return 1 ;
373
+ }
374
+
375
+ static inline void hugetlb_vma_assert_locked (struct vm_area_struct * vma )
376
+ {
377
+ }
378
+
340
379
static inline int pmd_huge (pmd_t pmd )
341
380
{
342
381
return 0 ;
0 commit comments