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, 34 insertions, 10 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 2723513a5651..41a59afc70fa 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -3,14 +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;
13
14int PageHuge(struct page *page); 15int PageHuge(struct page *page);
15 16
16static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) 17static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
@@ -19,11 +20,13 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
19} 20}
20 21
21void reset_vma_resv_huge_pages(struct vm_area_struct *vma); 22void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
22int 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 *);
23int 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 *);
24int 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 *);
25int 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 *);
26int 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);
27void unmap_hugepage_range(struct vm_area_struct *, 30void unmap_hugepage_range(struct vm_area_struct *,
28 unsigned long, unsigned long, struct page *); 31 unsigned long, unsigned long, struct page *);
29void __unmap_hugepage_range(struct vm_area_struct *, 32void __unmap_hugepage_range(struct vm_area_struct *,
@@ -109,6 +112,21 @@ static inline void hugetlb_report_meminfo(struct seq_file *m)
109 112
110#endif /* !CONFIG_HUGETLB_PAGE */ 113#endif /* !CONFIG_HUGETLB_PAGE */
111 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
112#ifdef CONFIG_HUGETLBFS 130#ifdef CONFIG_HUGETLBFS
113struct hugetlbfs_config { 131struct hugetlbfs_config {
114 uid_t uid; 132 uid_t uid;
@@ -145,8 +163,9 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
145} 163}
146 164
147extern const struct file_operations hugetlbfs_file_operations; 165extern const struct file_operations hugetlbfs_file_operations;
148extern struct vm_operations_struct hugetlb_vm_ops; 166extern const struct vm_operations_struct hugetlb_vm_ops;
149struct file *hugetlb_file_setup(const char *name, size_t, int); 167struct file *hugetlb_file_setup(const char *name, size_t size, int acct,
168 struct user_struct **user, int creat_flags);
150int hugetlb_get_quota(struct address_space *mapping, long delta); 169int hugetlb_get_quota(struct address_space *mapping, long delta);
151void hugetlb_put_quota(struct address_space *mapping, long delta); 170void hugetlb_put_quota(struct address_space *mapping, long delta);
152 171
@@ -168,7 +187,11 @@ static inline void set_file_hugepages(struct file *file)
168 187
169#define is_file_hugepages(file) 0 188#define is_file_hugepages(file) 0
170#define set_file_hugepages(file) BUG() 189#define set_file_hugepages(file) BUG()
171#define hugetlb_file_setup(name,size,acctflag) 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}
172 195
173#endif /* !CONFIG_HUGETLBFS */ 196#endif /* !CONFIG_HUGETLBFS */
174 197
@@ -183,7 +206,8 @@ unsigned long hugetlb_get_unmapped_area(struct file *file, unsigned long addr,
183#define HSTATE_NAME_LEN 32 206#define HSTATE_NAME_LEN 32
184/* Defines one hugetlb page size */ 207/* Defines one hugetlb page size */
185struct hstate { 208struct hstate {
186 int hugetlb_next_nid; 209 int next_nid_to_alloc;
210 int next_nid_to_free;
187 unsigned int order; 211 unsigned int order;
188 unsigned long mask; 212 unsigned long mask;
189 unsigned long max_huge_pages; 213 unsigned long max_huge_pages;