diff options
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r-- | include/linux/hugetlb.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index b75bdb4deba3..ba9263e631b9 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -100,6 +100,7 @@ struct hugetlbfs_config { | |||
100 | umode_t mode; | 100 | umode_t mode; |
101 | long nr_blocks; | 101 | long nr_blocks; |
102 | long nr_inodes; | 102 | long nr_inodes; |
103 | struct hstate *hstate; | ||
103 | }; | 104 | }; |
104 | 105 | ||
105 | struct hugetlbfs_sb_info { | 106 | struct hugetlbfs_sb_info { |
@@ -108,6 +109,7 @@ struct hugetlbfs_sb_info { | |||
108 | long max_inodes; /* inodes allowed */ | 109 | long max_inodes; /* inodes allowed */ |
109 | long free_inodes; /* inodes free */ | 110 | long free_inodes; /* inodes free */ |
110 | spinlock_t stat_lock; | 111 | spinlock_t stat_lock; |
112 | struct hstate *hstate; | ||
111 | }; | 113 | }; |
112 | 114 | ||
113 | 115 | ||
@@ -191,19 +193,21 @@ extern unsigned int default_hstate_idx; | |||
191 | 193 | ||
192 | #define default_hstate (hstates[default_hstate_idx]) | 194 | #define default_hstate (hstates[default_hstate_idx]) |
193 | 195 | ||
194 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) | 196 | static inline struct hstate *hstate_inode(struct inode *i) |
195 | { | 197 | { |
196 | return &default_hstate; | 198 | struct hugetlbfs_sb_info *hsb; |
199 | hsb = HUGETLBFS_SB(i->i_sb); | ||
200 | return hsb->hstate; | ||
197 | } | 201 | } |
198 | 202 | ||
199 | static inline struct hstate *hstate_file(struct file *f) | 203 | static inline struct hstate *hstate_file(struct file *f) |
200 | { | 204 | { |
201 | return &default_hstate; | 205 | return hstate_inode(f->f_dentry->d_inode); |
202 | } | 206 | } |
203 | 207 | ||
204 | static inline struct hstate *hstate_inode(struct inode *i) | 208 | static inline struct hstate *hstate_vma(struct vm_area_struct *vma) |
205 | { | 209 | { |
206 | return &default_hstate; | 210 | return hstate_file(vma->vm_file); |
207 | } | 211 | } |
208 | 212 | ||
209 | static inline unsigned long huge_page_size(struct hstate *h) | 213 | static inline unsigned long huge_page_size(struct hstate *h) |