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.h45
1 files changed, 14 insertions, 31 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index d9d6c868b86b..000837e126e6 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -14,6 +14,15 @@ struct user_struct;
14#include <linux/shm.h> 14#include <linux/shm.h>
15#include <asm/tlbflush.h> 15#include <asm/tlbflush.h>
16 16
17struct hugepage_subpool {
18 spinlock_t lock;
19 long count;
20 long max_hpages, used_hpages;
21};
22
23struct hugepage_subpool *hugepage_new_subpool(long nr_blocks);
24void hugepage_put_subpool(struct hugepage_subpool *spool);
25
17int PageHuge(struct page *page); 26int PageHuge(struct page *page);
18 27
19void reset_vma_resv_huge_pages(struct vm_area_struct *vma); 28void reset_vma_resv_huge_pages(struct vm_area_struct *vma);
@@ -128,35 +137,14 @@ enum {
128}; 137};
129 138
130#ifdef CONFIG_HUGETLBFS 139#ifdef CONFIG_HUGETLBFS
131struct hugetlbfs_config {
132 uid_t uid;
133 gid_t gid;
134 umode_t mode;
135 long nr_blocks;
136 long nr_inodes;
137 struct hstate *hstate;
138};
139
140struct hugetlbfs_sb_info { 140struct hugetlbfs_sb_info {
141 long max_blocks; /* blocks allowed */
142 long free_blocks; /* blocks free */
143 long max_inodes; /* inodes allowed */ 141 long max_inodes; /* inodes allowed */
144 long free_inodes; /* inodes free */ 142 long free_inodes; /* inodes free */
145 spinlock_t stat_lock; 143 spinlock_t stat_lock;
146 struct hstate *hstate; 144 struct hstate *hstate;
145 struct hugepage_subpool *spool;
147}; 146};
148 147
149
150struct hugetlbfs_inode_info {
151 struct shared_policy policy;
152 struct inode vfs_inode;
153};
154
155static inline struct hugetlbfs_inode_info *HUGETLBFS_I(struct inode *inode)
156{
157 return container_of(inode, struct hugetlbfs_inode_info, vfs_inode);
158}
159
160static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) 148static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
161{ 149{
162 return sb->s_fs_info; 150 return sb->s_fs_info;
@@ -164,10 +152,9 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb)
164 152
165extern const struct file_operations hugetlbfs_file_operations; 153extern const struct file_operations hugetlbfs_file_operations;
166extern const struct vm_operations_struct hugetlb_vm_ops; 154extern const struct vm_operations_struct hugetlb_vm_ops;
167struct file *hugetlb_file_setup(const char *name, size_t size, vm_flags_t acct, 155struct file *hugetlb_file_setup(const char *name, unsigned long addr,
156 size_t size, vm_flags_t acct,
168 struct user_struct **user, int creat_flags); 157 struct user_struct **user, int creat_flags);
169int hugetlb_get_quota(struct address_space *mapping, long delta);
170void hugetlb_put_quota(struct address_space *mapping, long delta);
171 158
172static inline int is_file_hugepages(struct file *file) 159static inline int is_file_hugepages(struct file *file)
173{ 160{
@@ -179,15 +166,11 @@ static inline int is_file_hugepages(struct file *file)
179 return 0; 166 return 0;
180} 167}
181 168
182static inline void set_file_hugepages(struct file *file)
183{
184 file->f_op = &hugetlbfs_file_operations;
185}
186#else /* !CONFIG_HUGETLBFS */ 169#else /* !CONFIG_HUGETLBFS */
187 170
188#define is_file_hugepages(file) 0 171#define is_file_hugepages(file) 0
189#define set_file_hugepages(file) BUG() 172static inline struct file *
190static inline struct file *hugetlb_file_setup(const char *name, size_t size, 173hugetlb_file_setup(const char *name, unsigned long addr, size_t size,
191 vm_flags_t acctflag, struct user_struct **user, int creat_flags) 174 vm_flags_t acctflag, struct user_struct **user, int creat_flags)
192{ 175{
193 return ERR_PTR(-ENOSYS); 176 return ERR_PTR(-ENOSYS);