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.h44
1 files changed, 33 insertions, 11 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 5cbc620bdfe0..41a59afc70fa 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -3,15 +3,15 @@
3 3
4#include <linux/fs.h> 4#include <linux/fs.h>
5 5
6struct ctl_table;
7struct user_struct;
8
6#ifdef CONFIG_HUGETLB_PAGE 9#ifdef CONFIG_HUGETLB_PAGE
7 10
8#include <linux/mempolicy.h> 11#include <linux/mempolicy.h>
9#include <linux/shm.h> 12#include <linux/shm.h>
10#include <asm/tlbflush.h> 13#include <asm/tlbflush.h>
11 14
12struct ctl_table;
13struct user_struct;
14
15int PageHuge(struct page *page); 15int PageHuge(struct page *page);
16 16
17static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) 17static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
@@ -20,11 +20,13 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
20} 20}
21 21
22void reset_vma_resv_huge_pages(struct vm_area_struct *vma); 22void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
23int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 23int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
24int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 24int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
25int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 25int hugetlb_treat_movable_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *);
26int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); 26int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
27int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); 27int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *,
28 struct page **, struct vm_area_struct **,
29 unsigned long *, int *, int, unsigned int flags);
28void unmap_hugepage_range(struct vm_area_struct *, 30void unmap_hugepage_range(struct vm_area_struct *,
29 unsigned long, unsigned long, struct page *); 31 unsigned long, unsigned long, struct page *);
30void __unmap_hugepage_range(struct vm_area_struct *, 32void __unmap_hugepage_range(struct vm_area_struct *,
@@ -110,6 +112,21 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
110 112
111#endif /* !CONFIG_HUGETLB_PAGE */ 113#endif /* !CONFIG_HUGETLB_PAGE */
112 114
115#define HUGETLB_ANON_FILE "anon_hugepage"
116
117enum {
118 /*
119 * The file will be used as an shm file so shmfs accounting rules
120 * apply
121 */
122 HUGETLB_SHMFS_INODE = 1,
123 /*
124 * The file is being created on the internal vfs mount and shmfs
125 * accounting rules do not apply
126 */
127 HUGETLB_ANONHUGE_INODE = 2,
128};
129
113#ifdef CONFIG_HUGETLBFS 130#ifdef CONFIG_HUGETLBFS
114struct hugetlbfs_config { 131struct hugetlbfs_config {
115 uid_t uid; 132 uid_t uid;
@@ -146,9 +163,9 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
146} 163}
147 164
148extern const struct file_operations hugetlbfs_file_operations; 165extern const struct file_operations hugetlbfs_file_operations;
149extern struct vm_operations_struct hugetlb_vm_ops; 166extern const struct vm_operations_struct hugetlb_vm_ops;
150struct file *hugetlb_file_setup(const char *name, size_t size, int acct, 167struct file *hugetlb_file_setup(const char *name, size_t size, int acct,
151 struct user_struct **user); 168 struct user_struct **user, int creat_flags);
152int hugetlb_get_quota(struct address_space *mapping, long delta); 169int hugetlb_get_quota(struct address_space *mapping, long delta);
153void hugetlb_put_quota(struct address_space *mapping, long delta); 170void hugetlb_put_quota(struct address_space *mapping, long delta);
154 171
@@ -170,7 +187,11 @@ static inline void set_file_hugepages(struct file *file)
170 187
171#define is_file_hugepages(file) 0 188#define is_file_hugepages(file) 0
172#define set_file_hugepages(file) BUG() 189#define set_file_hugepages(file) BUG()
173#define hugetlb_file_setup(name,size,acct,user) ERR_PTR(-ENOSYS) 190static inline struct file *hugetlb_file_setup(const char *name, size_t size,
191 int acctflag, struct user_struct **user, int creat_flags)
192{
193 return ERR_PTR(-ENOSYS);
194}
174 195
175#endif /* !CONFIG_HUGETLBFS */ 196#endif /* !CONFIG_HUGETLBFS */
176 197
@@ -185,7 +206,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
185#define HSTATE_NAME_LEN 32 206#define HSTATE_NAME_LEN 32
186/* Defines one hugetlb page size */ 207/* Defines one hugetlb page size */
187struct hstate { 208struct hstate {
188 int hugetlb_next_nid; 209 int next_nid_to_alloc;
210 int next_nid_to_free;
189 unsigned int order; 211 unsigned int order;
190 unsigned long mask; 212 unsigned long mask;
191 unsigned long max_huge_pages; 213 unsigned long max_huge_pages;