]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/linux/hugetlb.h
[PATCH] Handle spurious page fault for hugetlb region
[karo-tx-linux.git] / include / linux / hugetlb.h
index f529d144281521552491058d1b5ed66d47bc8d71..42cb7d70f9acf9be8e3c13d40b87f340c38cfa6a 100644 (file)
@@ -70,12 +70,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
 void hugetlb_prefault_arch_hook(struct mm_struct *mm);
 #endif
 
-#ifndef ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE
-#define hugetlb_clean_stale_pgtable(pte)       BUG()
-#else
-void hugetlb_clean_stale_pgtable(pte_t *pte);
-#endif
-
 #else /* !CONFIG_HUGETLB_PAGE */
 
 static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
@@ -161,11 +155,24 @@ static inline void set_file_hugepages(struct file *file)
 {
        file->f_op = &hugetlbfs_file_operations;
 }
+
+static inline int valid_hugetlb_file_off(struct vm_area_struct *vma, 
+                                         unsigned long address) 
+{
+       struct inode *inode = vma->vm_file->f_dentry->d_inode;
+       loff_t file_off = address - vma->vm_start;
+       
+       file_off += (vma->vm_pgoff << PAGE_SHIFT);
+       
+       return (file_off < inode->i_size);
+}
+
 #else /* !CONFIG_HUGETLBFS */
 
 #define is_file_hugepages(file)                0
 #define set_file_hugepages(file)       BUG()
 #define hugetlb_zero_setup(size)       ERR_PTR(-ENOSYS)
+#define valid_hugetlb_file_off(vma, address)   0
 
 #endif /* !CONFIG_HUGETLBFS */