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.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 82a25880714a..36fa6a2a82e3 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -119,6 +119,7 @@ long hugetlb_unreserve_pages(struct inode *inode, long start, long end,
119 long freed); 119 long freed);
120bool isolate_huge_page(struct page *page, struct list_head *list); 120bool isolate_huge_page(struct page *page, struct list_head *list);
121void putback_active_hugepage(struct page *page); 121void putback_active_hugepage(struct page *page);
122void move_hugetlb_state(struct page *oldpage, struct page *newpage, int reason);
122void free_huge_page(struct page *page); 123void free_huge_page(struct page *page);
123void hugetlb_fix_reserve_counts(struct inode *inode); 124void hugetlb_fix_reserve_counts(struct inode *inode);
124extern struct mutex *hugetlb_fault_mutex_table; 125extern struct mutex *hugetlb_fault_mutex_table;
@@ -129,7 +130,6 @@ u32 hugetlb_fault_mutex_hash(struct hstate *h, struct mm_struct *mm,
129 130
130pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud); 131pte_t *huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud);
131 132
132extern int hugepages_treat_as_movable;
133extern int sysctl_hugetlb_shm_group; 133extern int sysctl_hugetlb_shm_group;
134extern struct list_head huge_boot_pages; 134extern struct list_head huge_boot_pages;
135 135
@@ -158,6 +158,7 @@ unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
158 unsigned long address, unsigned long end, pgprot_t newprot); 158 unsigned long address, unsigned long end, pgprot_t newprot);
159 159
160bool is_hugetlb_entry_migration(pte_t pte); 160bool is_hugetlb_entry_migration(pte_t pte);
161
161#else /* !CONFIG_HUGETLB_PAGE */ 162#else /* !CONFIG_HUGETLB_PAGE */
162 163
163static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma) 164static inline void reset_vma_resv_huge_pages(struct vm_area_struct *vma)
@@ -198,6 +199,7 @@ static inline bool isolate_huge_page(struct page *page, struct list_head *list)
198 return false; 199 return false;
199} 200}
200#define putback_active_hugepage(p) do {} while (0) 201#define putback_active_hugepage(p) do {} while (0)
202#define move_hugetlb_state(old, new, reason) do {} while (0)
201 203
202static inline unsigned long hugetlb_change_protection(struct vm_area_struct *vma, 204static inline unsigned long hugetlb_change_protection(struct vm_area_struct *vma,
203 unsigned long address, unsigned long end, pgprot_t newprot) 205 unsigned long address, unsigned long end, pgprot_t newprot)
@@ -271,6 +273,17 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
271 return sb->s_fs_info; 273 return sb->s_fs_info;
272} 274}
273 275
276struct hugetlbfs_inode_info {
277 struct shared_policy policy;
278 struct inode vfs_inode;
279 unsigned int seals;
280};
281
282static inline struct hugetlbfs_inode_info *HUGETLBFS_I(struct inode *inode)
283{
284 return container_of(inode, struct hugetlbfs_inode_info, vfs_inode);
285}
286
274extern const struct file_operations hugetlbfs_file_operations; 287extern const struct file_operations hugetlbfs_file_operations;
275extern const struct vm_operations_struct hugetlb_vm_ops; 288extern const struct vm_operations_struct hugetlb_vm_ops;
276struct file *hugetlb_file_setup(const char *name, size_t size, vm_flags_t acct, 289struct file *hugetlb_file_setup(const char *name, size_t size, vm_flags_t acct,
@@ -343,10 +356,10 @@ struct huge_bootmem_page {
343struct page *alloc_huge_page(struct vm_area_struct *vma, 356struct page *alloc_huge_page(struct vm_area_struct *vma,
344 unsigned long addr, int avoid_reserve); 357 unsigned long addr, int avoid_reserve);
345struct page *alloc_huge_page_node(struct hstate *h, int nid); 358struct page *alloc_huge_page_node(struct hstate *h, int nid);
346struct page *alloc_huge_page_noerr(struct vm_area_struct *vma,
347 unsigned long addr, int avoid_reserve);
348struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid, 359struct page *alloc_huge_page_nodemask(struct hstate *h, int preferred_nid,
349 nodemask_t *nmask); 360 nodemask_t *nmask);
361struct page *alloc_huge_page_vma(struct hstate *h, struct vm_area_struct *vma,
362 unsigned long address);
350int huge_add_to_page_cache(struct page *page, struct address_space *mapping, 363int huge_add_to_page_cache(struct page *page, struct address_space *mapping,
351 pgoff_t idx); 364 pgoff_t idx);
352 365
@@ -524,7 +537,7 @@ struct hstate {};
524#define alloc_huge_page(v, a, r) NULL 537#define alloc_huge_page(v, a, r) NULL
525#define alloc_huge_page_node(h, nid) NULL 538#define alloc_huge_page_node(h, nid) NULL
526#define alloc_huge_page_nodemask(h, preferred_nid, nmask) NULL 539#define alloc_huge_page_nodemask(h, preferred_nid, nmask) NULL
527#define alloc_huge_page_noerr(v, a, r) NULL 540#define alloc_huge_page_vma(h, vma, address) NULL
528#define alloc_bootmem_huge_page(h) NULL 541#define alloc_bootmem_huge_page(h) NULL
529#define hstate_file(f) NULL 542#define hstate_file(f) NULL
530#define hstate_sizelog(s) NULL 543#define hstate_sizelog(s) NULL