diff options
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 45 |
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 | ||
17 | struct hugepage_subpool { | ||
18 | spinlock_t lock; | ||
19 | long count; | ||
20 | long max_hpages, used_hpages; | ||
21 | }; | ||
22 | |||
23 | struct hugepage_subpool *hugepage_new_subpool(long nr_blocks); | ||
24 | void hugepage_put_subpool(struct hugepage_subpool *spool); | ||
25 | |||
17 | int PageHuge(struct page *page); | 26 | int PageHuge(struct page *page); |
18 | 27 | ||
19 | void reset_vma_resv_huge_pages(struct vm_area_struct *vma); | 28 | void 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 |
131 | struct 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 | |||
140 | struct hugetlbfs_sb_info { | 140 | struct 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 | |||
150 | struct hugetlbfs_inode_info { | ||
151 | struct shared_policy policy; | ||
152 | struct inode vfs_inode; | ||
153 | }; | ||
154 | |||
155 | static inline struct hugetlbfs_inode_info *HUGETLBFS_I(struct inode *inode) | ||
156 | { | ||
157 | return container_of(inode, struct hugetlbfs_inode_info, vfs_inode); | ||
158 | } | ||
159 | |||
160 | static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | 148 | static 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 | ||
165 | extern const struct file_operations hugetlbfs_file_operations; | 153 | extern const struct file_operations hugetlbfs_file_operations; |
166 | extern const struct vm_operations_struct hugetlb_vm_ops; | 154 | extern const struct vm_operations_struct hugetlb_vm_ops; |
167 | struct file *hugetlb_file_setup(const char *name, size_t size, vm_flags_t acct, | 155 | struct 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); |
169 | int hugetlb_get_quota(struct address_space *mapping, long delta); | ||
170 | void hugetlb_put_quota(struct address_space *mapping, long delta); | ||
171 | 158 | ||
172 | static inline int is_file_hugepages(struct file *file) | 159 | static 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 | ||
182 | static 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() | 172 | static inline struct file * |
190 | static inline struct file *hugetlb_file_setup(const char *name, size_t size, | 173 | hugetlb_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); |