diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/hugetlb.h | 1 | ||||
-rw-r--r-- | include/linux/pagemap.h | 8 | ||||
-rw-r--r-- | include/linux/poison.h | 9 | ||||
-rw-r--r-- | include/linux/rmap.h | 5 |
4 files changed, 13 insertions, 10 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index d47a7c41745d..e688fd89354d 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -99,6 +99,7 @@ static inline void hugetlb_report_meminfo(struct seq_file *m) | |||
99 | #define is_hugepage_only_range(mm, addr, len) 0 | 99 | #define is_hugepage_only_range(mm, addr, len) 0 |
100 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) | 100 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
101 | #define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; }) | 101 | #define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; }) |
102 | #define huge_pte_offset(mm, address) 0 | ||
102 | 103 | ||
103 | #define hugetlb_change_protection(vma, address, end, newprot) | 104 | #define hugetlb_change_protection(vma, address, end, newprot) |
104 | 105 | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index b2bd2bae9775..a547d9689170 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -282,10 +282,16 @@ static inline loff_t page_offset(struct page *page) | |||
282 | return ((loff_t)page->index) << PAGE_CACHE_SHIFT; | 282 | return ((loff_t)page->index) << PAGE_CACHE_SHIFT; |
283 | } | 283 | } |
284 | 284 | ||
285 | extern pgoff_t linear_hugepage_index(struct vm_area_struct *vma, | ||
286 | unsigned long address); | ||
287 | |||
285 | static inline pgoff_t linear_page_index(struct vm_area_struct *vma, | 288 | static inline pgoff_t linear_page_index(struct vm_area_struct *vma, |
286 | unsigned long address) | 289 | unsigned long address) |
287 | { | 290 | { |
288 | pgoff_t pgoff = (address - vma->vm_start) >> PAGE_SHIFT; | 291 | pgoff_t pgoff; |
292 | if (unlikely(is_vm_hugetlb_page(vma))) | ||
293 | return linear_hugepage_index(vma, address); | ||
294 | pgoff = (address - vma->vm_start) >> PAGE_SHIFT; | ||
289 | pgoff += vma->vm_pgoff; | 295 | pgoff += vma->vm_pgoff; |
290 | return pgoff >> (PAGE_CACHE_SHIFT - PAGE_SHIFT); | 296 | return pgoff >> (PAGE_CACHE_SHIFT - PAGE_SHIFT); |
291 | } | 297 | } |
diff --git a/include/linux/poison.h b/include/linux/poison.h index 34066ffd893d..2110a81c5e2a 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
@@ -48,15 +48,6 @@ | |||
48 | #define POISON_FREE 0x6b /* for use-after-free poisoning */ | 48 | #define POISON_FREE 0x6b /* for use-after-free poisoning */ |
49 | #define POISON_END 0xa5 /* end-byte of poisoning */ | 49 | #define POISON_END 0xa5 /* end-byte of poisoning */ |
50 | 50 | ||
51 | /********** mm/hugetlb.c **********/ | ||
52 | /* | ||
53 | * Private mappings of hugetlb pages use this poisoned value for | ||
54 | * page->mapping. The core VM should not be doing anything with this mapping | ||
55 | * but futex requires the existence of some page->mapping value even though it | ||
56 | * is unused if PAGE_MAPPING_ANON is set. | ||
57 | */ | ||
58 | #define HUGETLB_POISON ((void *)(0x00300300 + POISON_POINTER_DELTA + PAGE_MAPPING_ANON)) | ||
59 | |||
60 | /********** arch/$ARCH/mm/init.c **********/ | 51 | /********** arch/$ARCH/mm/init.c **********/ |
61 | #define POISON_FREE_INITMEM 0xcc | 52 | #define POISON_FREE_INITMEM 0xcc |
62 | 53 | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 77216742c178..9d50e7ef5f5a 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -140,6 +140,11 @@ void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned lon | |||
140 | void page_add_file_rmap(struct page *); | 140 | void page_add_file_rmap(struct page *); |
141 | void page_remove_rmap(struct page *); | 141 | void page_remove_rmap(struct page *); |
142 | 142 | ||
143 | void hugepage_add_anon_rmap(struct page *, struct vm_area_struct *, | ||
144 | unsigned long); | ||
145 | void hugepage_add_new_anon_rmap(struct page *, struct vm_area_struct *, | ||
146 | unsigned long); | ||
147 | |||
143 | static inline void page_dup_rmap(struct page *page) | 148 | static inline void page_dup_rmap(struct page *page) |
144 | { | 149 | { |
145 | atomic_inc(&page->_mapcount); | 150 | atomic_inc(&page->_mapcount); |