@@ -824,11 +824,24 @@ static void insert_pfn_pmd(struct vm_area_struct *vma, unsigned long addr,
824
824
pte_free (mm , pgtable );
825
825
}
826
826
827
- vm_fault_t vmf_insert_pfn_pmd (struct vm_fault * vmf , pfn_t pfn , bool write )
827
+ /**
828
+ * vmf_insert_pfn_pmd_prot - insert a pmd size pfn
829
+ * @vmf: Structure describing the fault
830
+ * @pfn: pfn to insert
831
+ * @pgprot: page protection to use
832
+ * @write: whether it's a write fault
833
+ *
834
+ * Insert a pmd size pfn. See vmf_insert_pfn() for additional info and
835
+ * also consult the vmf_insert_mixed_prot() documentation when
836
+ * @pgprot != @vmf->vma->vm_page_prot.
837
+ *
838
+ * Return: vm_fault_t value.
839
+ */
840
+ vm_fault_t vmf_insert_pfn_pmd_prot (struct vm_fault * vmf , pfn_t pfn ,
841
+ pgprot_t pgprot , bool write )
828
842
{
829
843
unsigned long addr = vmf -> address & PMD_MASK ;
830
844
struct vm_area_struct * vma = vmf -> vma ;
831
- pgprot_t pgprot = vma -> vm_page_prot ;
832
845
pgtable_t pgtable = NULL ;
833
846
834
847
/*
@@ -856,7 +869,7 @@ vm_fault_t vmf_insert_pfn_pmd(struct vm_fault *vmf, pfn_t pfn, bool write)
856
869
insert_pfn_pmd (vma , addr , vmf -> pmd , pfn , pgprot , write , pgtable );
857
870
return VM_FAULT_NOPAGE ;
858
871
}
859
- EXPORT_SYMBOL_GPL (vmf_insert_pfn_pmd );
872
+ EXPORT_SYMBOL_GPL (vmf_insert_pfn_pmd_prot );
860
873
861
874
#ifdef CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
862
875
static pud_t maybe_pud_mkwrite (pud_t pud , struct vm_area_struct * vma )
@@ -902,11 +915,24 @@ static void insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
902
915
spin_unlock (ptl );
903
916
}
904
917
905
- vm_fault_t vmf_insert_pfn_pud (struct vm_fault * vmf , pfn_t pfn , bool write )
918
+ /**
919
+ * vmf_insert_pfn_pud_prot - insert a pud size pfn
920
+ * @vmf: Structure describing the fault
921
+ * @pfn: pfn to insert
922
+ * @pgprot: page protection to use
923
+ * @write: whether it's a write fault
924
+ *
925
+ * Insert a pud size pfn. See vmf_insert_pfn() for additional info and
926
+ * also consult the vmf_insert_mixed_prot() documentation when
927
+ * @pgprot != @vmf->vma->vm_page_prot.
928
+ *
929
+ * Return: vm_fault_t value.
930
+ */
931
+ vm_fault_t vmf_insert_pfn_pud_prot (struct vm_fault * vmf , pfn_t pfn ,
932
+ pgprot_t pgprot , bool write )
906
933
{
907
934
unsigned long addr = vmf -> address & PUD_MASK ;
908
935
struct vm_area_struct * vma = vmf -> vma ;
909
- pgprot_t pgprot = vma -> vm_page_prot ;
910
936
911
937
/*
912
938
* If we had pud_special, we could avoid all these restrictions,
@@ -927,7 +953,7 @@ vm_fault_t vmf_insert_pfn_pud(struct vm_fault *vmf, pfn_t pfn, bool write)
927
953
insert_pfn_pud (vma , addr , vmf -> pud , pfn , pgprot , write );
928
954
return VM_FAULT_NOPAGE ;
929
955
}
930
- EXPORT_SYMBOL_GPL (vmf_insert_pfn_pud );
956
+ EXPORT_SYMBOL_GPL (vmf_insert_pfn_pud_prot );
931
957
#endif /* CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD */
932
958
933
959
static void touch_pmd (struct vm_area_struct * vma , unsigned long addr ,
0 commit comments