@@ -793,11 +793,13 @@ static void insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
793793 pte_free (mm , pgtable );
794794}
795795
796- vm_fault_t vmf_insert_pfn_pmd (struct vm_area_struct * vma , unsigned long addr ,
797- pmd_t * pmd , pfn_t pfn , bool write )
796+ vm_fault_t vmf_insert_pfn_pmd (struct vm_fault * vmf , pfn_t pfn , bool write )
798797{
798+ unsigned long addr = vmf -> address & PMD_MASK ;
799+ struct vm_area_struct * vma = vmf -> vma ;
799800 pgprot_t pgprot = vma -> vm_page_prot ;
800801 pgtable_t pgtable = NULL ;
802+
801803 /*
802804 * If we had pmd_special, we could avoid all these restrictions,
803805 * but we need to be consistent with PTEs and architectures that
@@ -820,7 +822,7 @@ vm_fault_t vmf_insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
820822
821823 track_pfn_insert (vma , & pgprot , pfn );
822824
823- insert_pfn_pmd (vma , addr , pmd , pfn , pgprot , write , pgtable );
825+ insert_pfn_pmd (vma , addr , vmf -> pmd , pfn , pgprot , write , pgtable );
824826 return VM_FAULT_NOPAGE ;
825827}
826828EXPORT_SYMBOL_GPL (vmf_insert_pfn_pmd );
@@ -869,10 +871,12 @@ static void insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
869871 spin_unlock (ptl );
870872}
871873
872- vm_fault_t vmf_insert_pfn_pud (struct vm_area_struct * vma , unsigned long addr ,
873- pud_t * pud , pfn_t pfn , bool write )
874+ vm_fault_t vmf_insert_pfn_pud (struct vm_fault * vmf , pfn_t pfn , bool write )
874875{
876+ unsigned long addr = vmf -> address & PUD_MASK ;
877+ struct vm_area_struct * vma = vmf -> vma ;
875878 pgprot_t pgprot = vma -> vm_page_prot ;
879+
876880 /*
877881 * If we had pud_special, we could avoid all these restrictions,
878882 * but we need to be consistent with PTEs and architectures that
@@ -889,7 +893,7 @@ vm_fault_t vmf_insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
889893
890894 track_pfn_insert (vma , & pgprot , pfn );
891895
892- insert_pfn_pud (vma , addr , pud , pfn , pgprot , write );
896+ insert_pfn_pud (vma , addr , vmf -> pud , pfn , pgprot , write );
893897 return VM_FAULT_NOPAGE ;
894898}
895899EXPORT_SYMBOL_GPL (vmf_insert_pfn_pud );
0 commit comments