aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2005-10-20 11:24:28 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-10-20 12:02:07 -0400
commitac9b9c667c2e1194e22ebe0a441ae1c37aaa9b90 (patch)
tree3903d87d0b56a49ead39c0460b5bc0b86b040775 /include
parent93918e9afc76717176e9e114e79cdbb602a45ae8 (diff)
[PATCH] Fix handling spurious page fault for hugetlb region
This reverts commit 3359b54c8c07338f3a863d1109b42eebccdcf379 and replaces it with a cleaner version that is purely based on page table operations, so that the synchronization between inode size and hugetlb mappings becomes moot. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/hugetlb.h16
1 files changed, 3 insertions, 13 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 42cb7d70f9ac..d664330d900e 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -25,6 +25,8 @@ int is_hugepage_mem_enough(size_t);
25unsigned long hugetlb_total_pages(void); 25unsigned long hugetlb_total_pages(void);
26struct page *alloc_huge_page(void); 26struct page *alloc_huge_page(void);
27void free_huge_page(struct page *); 27void free_huge_page(struct page *);
28int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
29 unsigned long address, int write_access);
28 30
29extern unsigned long max_huge_pages; 31extern unsigned long max_huge_pages;
30extern const unsigned long hugetlb_zero, hugetlb_infinity; 32extern const unsigned long hugetlb_zero, hugetlb_infinity;
@@ -99,6 +101,7 @@ static inline unsigned long hugetlb_total_pages(void)
99 do { } while (0) 101 do { } while (0)
100#define alloc_huge_page() ({ NULL; }) 102#define alloc_huge_page() ({ NULL; })
101#define free_huge_page(p) ({ (void)(p); BUG(); }) 103#define free_huge_page(p) ({ (void)(p); BUG(); })
104#define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; })
102 105
103#ifndef HPAGE_MASK 106#ifndef HPAGE_MASK
104#define HPAGE_MASK 0 /* Keep the compiler happy */ 107#define HPAGE_MASK 0 /* Keep the compiler happy */
@@ -155,24 +158,11 @@ static inline void set_file_hugepages(struct file *file)
155{ 158{
156 file->f_op = &hugetlbfs_file_operations; 159 file->f_op = &hugetlbfs_file_operations;
157} 160}
158
159static inline int valid_hugetlb_file_off(struct vm_area_struct *vma,
160 unsigned long address)
161{
162 struct inode *inode = vma->vm_file->f_dentry->d_inode;
163 loff_t file_off = address - vma->vm_start;
164
165 file_off += (vma->vm_pgoff << PAGE_SHIFT);
166
167 return (file_off < inode->i_size);
168}
169
170#else /* !CONFIG_HUGETLBFS */ 161#else /* !CONFIG_HUGETLBFS */
171 162
172#define is_file_hugepages(file) 0 163#define is_file_hugepages(file) 0
173#define set_file_hugepages(file) BUG() 164#define set_file_hugepages(file) BUG()
174#define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS) 165#define hugetlb_zero_setup(size) ERR_PTR(-ENOSYS)
175#define valid_hugetlb_file_off(vma, address) 0
176 166
177#endif /* !CONFIG_HUGETLBFS */ 167#endif /* !CONFIG_HUGETLBFS */
178 168