aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hugetlb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r--include/linux/hugetlb.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index f479700df61b..59225ef27d15 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_HUGETLB_H 1#ifndef _LINUX_HUGETLB_H
2#define _LINUX_HUGETLB_H 2#define _LINUX_HUGETLB_H
3 3
4#include <linux/mm_types.h>
4#include <linux/fs.h> 5#include <linux/fs.h>
5#include <linux/hugetlb_inline.h> 6#include <linux/hugetlb_inline.h>
6 7
@@ -41,9 +42,10 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
41 unsigned long address, unsigned int flags); 42 unsigned long address, unsigned int flags);
42int hugetlb_reserve_pages(struct inode *inode, long from, long to, 43int hugetlb_reserve_pages(struct inode *inode, long from, long to,
43 struct vm_area_struct *vma, 44 struct vm_area_struct *vma,
44 int acctflags); 45 vm_flags_t vm_flags);
45void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); 46void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
46void __isolate_hwpoisoned_huge_page(struct page *page); 47int dequeue_hwpoisoned_huge_page(struct page *page);
48void copy_huge_page(struct page *dst, struct page *src);
47 49
48extern unsigned long hugepages_treat_as_movable; 50extern unsigned long hugepages_treat_as_movable;
49extern const unsigned long hugetlb_zero, hugetlb_infinity; 51extern const unsigned long hugetlb_zero, hugetlb_infinity;
@@ -101,7 +103,10 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
101#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 103#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
102#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; }) 104#define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; })
103#define huge_pte_offset(mm, address) 0 105#define huge_pte_offset(mm, address) 0
104#define __isolate_hwpoisoned_huge_page(page) 0 106#define dequeue_hwpoisoned_huge_page(page) 0
107static inline void copy_huge_page(struct page *dst, struct page *src)
108{
109}
105 110
106#define hugetlb_change_protection(vma, address, end, newprot) 111#define hugetlb_change_protection(vma, address, end, newprot)
107 112
@@ -164,7 +169,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
164 169
165extern const struct file_operations hugetlbfs_file_operations; 170extern const struct file_operations hugetlbfs_file_operations;
166extern const struct vm_operations_struct hugetlb_vm_ops; 171extern const struct vm_operations_struct hugetlb_vm_ops;
167struct file *hugetlb_file_setup(const char *name, size_t size, int acct, 172struct file *hugetlb_file_setup(const char *name, size_t size, vm_flags_t acct,
168 struct user_struct **user, int creat_flags); 173 struct user_struct **user, int creat_flags);
169int hugetlb_get_quota(struct address_space *mapping, long delta); 174int hugetlb_get_quota(struct address_space *mapping, long delta);
170void hugetlb_put_quota(struct address_space *mapping, long delta); 175void hugetlb_put_quota(struct address_space *mapping, long delta);
@@ -188,7 +193,7 @@ static inline void set_file_hugepages(struct file *file)
188#define is_file_hugepages(file) 0 193#define is_file_hugepages(file) 0
189#define set_file_hugepages(file) BUG() 194#define set_file_hugepages(file) BUG()
190static inline struct file *hugetlb_file_setup(const char *name, size_t size, 195static inline struct file *hugetlb_file_setup(const char *name, size_t size,
191 int acctflag, struct user_struct **user, int creat_flags) 196 vm_flags_t acctflag, struct user_struct **user, int creat_flags)
192{ 197{
193 return ERR_PTR(-ENOSYS); 198 return ERR_PTR(-ENOSYS);
194} 199}
@@ -228,6 +233,8 @@ struct huge_bootmem_page {
228 struct hstate *hstate; 233 struct hstate *hstate;
229}; 234};
230 235
236struct page *alloc_huge_page_node(struct hstate *h, int nid);
237
231/* arch callback */ 238/* arch callback */
232int __init alloc_bootmem_huge_page(struct hstate *h); 239int __init alloc_bootmem_huge_page(struct hstate *h);
233 240
@@ -301,8 +308,14 @@ static inline struct hstate *page_hstate(struct page *page)
301 return size_to_hstate(PAGE_SIZE << compound_order(page)); 308 return size_to_hstate(PAGE_SIZE << compound_order(page));
302} 309}
303 310
311static inline unsigned hstate_index_to_shift(unsigned index)
312{
313 return hstates[index].order + PAGE_SHIFT;
314}
315
304#else 316#else
305struct hstate {}; 317struct hstate {};
318#define alloc_huge_page_node(h, nid) NULL
306#define alloc_bootmem_huge_page(h) NULL 319#define alloc_bootmem_huge_page(h) NULL
307#define hstate_file(f) NULL 320#define hstate_file(f) NULL
308#define hstate_vma(v) NULL 321#define hstate_vma(v) NULL
@@ -317,6 +330,7 @@ static inline unsigned int pages_per_huge_page(struct hstate *h)
317{ 330{
318 return 1; 331 return 1;
319} 332}
333#define hstate_index_to_shift(index) 0
320#endif 334#endif
321 335
322#endif /* _LINUX_HUGETLB_H */ 336#endif /* _LINUX_HUGETLB_H */