aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/hugetlb.h4
-rw-r--r--mm/hugetlb.c5
-rw-r--r--mm/memory.c2
3 files changed, 6 insertions, 5 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index ea0f50bfbe03..e22368656b38 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -19,7 +19,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
19int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 19int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
20int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 20int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
21int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); 21int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
22int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); 22int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int, int);
23void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); 23void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
24void __unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); 24void __unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
25int hugetlb_prefault(struct address_space *, struct vm_area_struct *); 25int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
@@ -106,7 +106,7 @@ static inline unsigned long hugetlb_total_pages(void)
106 return 0; 106 return 0;
107} 107}
108 108
109#define follow_hugetlb_page(m,v,p,vs,a,b,i) ({ BUG(); 0; }) 109#define follow_hugetlb_page(m,v,p,vs,a,b,i,w) ({ BUG(); 0; })
110#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL) 110#define follow_huge_addr(mm, addr, write) ERR_PTR(-EINVAL)
111#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) 111#define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
112#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) 112#define hugetlb_prefault(mapping, vma) ({ BUG(); 0; })
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 8b809ecefa39..e2c80631d36a 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -868,7 +868,8 @@ int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
868 868
869int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma, 869int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
870 struct page **pages, struct vm_area_struct **vmas, 870 struct page **pages, struct vm_area_struct **vmas,
871 unsigned long *position, int *length, int i) 871 unsigned long *position, int *length, int i,
872 int write)
872{ 873{
873 unsigned long pfn_offset; 874 unsigned long pfn_offset;
874 unsigned long vaddr = *position; 875 unsigned long vaddr = *position;
@@ -890,7 +891,7 @@ int follow_hugetlb_page(struct mm_struct *mm, struct vm_area_struct *vma,
890 int ret; 891 int ret;
891 892
892 spin_unlock(&mm->page_table_lock); 893 spin_unlock(&mm->page_table_lock);
893 ret = hugetlb_fault(mm, vma, vaddr, 0); 894 ret = hugetlb_fault(mm, vma, vaddr, write);
894 spin_lock(&mm->page_table_lock); 895 spin_lock(&mm->page_table_lock);
895 if (!(ret & VM_FAULT_ERROR)) 896 if (!(ret & VM_FAULT_ERROR))
896 continue; 897 continue;
diff --git a/mm/memory.c b/mm/memory.c
index 9791e4786843..7b0403bfc97f 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1036,7 +1036,7 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
1036 1036
1037 if (is_vm_hugetlb_page(vma)) { 1037 if (is_vm_hugetlb_page(vma)) {
1038 i = follow_hugetlb_page(mm, vma, pages, vmas, 1038 i = follow_hugetlb_page(mm, vma, pages, vmas,
1039 &start, &len, i); 1039 &start, &len, i, write);
1040 continue; 1040 continue;
1041 } 1041 }
1042 1042