diff options
Diffstat (limited to 'include/linux/hugetlb.h')
| -rw-r--r-- | include/linux/hugetlb.h | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 5cbc620bdfe0..16937995abd4 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 | ||
| 6 | struct ctl_table; | ||
| 7 | struct 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 | ||
| 12 | struct ctl_table; | ||
| 13 | struct user_struct; | ||
| 14 | |||
| 15 | int PageHuge(struct page *page); | 15 | int PageHuge(struct page *page); |
| 16 | 16 | ||
| 17 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 17 | static 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 | ||
| 22 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | 22 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); |
| 23 | int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 23 | int hugetlb_sysctl_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| 24 | int hugetlb_overcommit_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 24 | int hugetlb_overcommit_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| 25 | int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); | 25 | int hugetlb_treat_movable_handler(struct ctl_table *, int, void __user *, size_t *, loff_t *); |
| 26 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); | 26 | int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); |
| 27 | int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int); | 27 | int 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); | ||
| 28 | void unmap_hugepage_range(struct vm_area_struct *, | 30 | void unmap_hugepage_range(struct vm_area_struct *, |
| 29 | unsigned long, unsigned long, struct page *); | 31 | unsigned long, unsigned long, struct page *); |
| 30 | void __unmap_hugepage_range(struct vm_area_struct *, | 32 | void __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 | |||
| 117 | enum { | ||
| 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 |
| 114 | struct hugetlbfs_config { | 131 | struct hugetlbfs_config { |
| 115 | uid_t uid; | 132 | uid_t uid; |
| @@ -148,7 +165,7 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
| 148 | extern const struct file_operations hugetlbfs_file_operations; | 165 | extern const struct file_operations hugetlbfs_file_operations; |
| 149 | extern struct vm_operations_struct hugetlb_vm_ops; | 166 | extern struct vm_operations_struct hugetlb_vm_ops; |
| 150 | struct file *hugetlb_file_setup(const char *name, size_t size, int acct, | 167 | struct 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); |
| 152 | int hugetlb_get_quota(struct address_space *mapping, long delta); | 169 | int hugetlb_get_quota(struct address_space *mapping, long delta); |
| 153 | void hugetlb_put_quota(struct address_space *mapping, long delta); | 170 | void 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) | 190 | static 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 */ |
| 187 | struct hstate { | 208 | struct 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; |
