File tree Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Expand file tree Collapse file tree 1 file changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -951,23 +951,20 @@ static void free_pfn_range(u64 paddr, unsigned long size)
951
951
static int follow_phys (struct vm_area_struct * vma , unsigned long * prot ,
952
952
resource_size_t * phys )
953
953
{
954
- pte_t * ptep , pte ;
955
- spinlock_t * ptl ;
954
+ struct follow_pfnmap_args args = { .vma = vma , .address = vma -> vm_start };
956
955
957
- if (follow_pte ( vma , vma -> vm_start , & ptep , & ptl ))
956
+ if (follow_pfnmap_start ( & args ))
958
957
return - EINVAL ;
959
958
960
- pte = ptep_get (ptep );
961
-
962
959
/* Never return PFNs of anon folios in COW mappings. */
963
- if (vm_normal_folio ( vma , vma -> vm_start , pte ) ) {
964
- pte_unmap_unlock ( ptep , ptl );
960
+ if (! args . special ) {
961
+ follow_pfnmap_end ( & args );
965
962
return - EINVAL ;
966
963
}
967
964
968
- * prot = pgprot_val (pte_pgprot ( pte ) );
969
- * phys = (resource_size_t )pte_pfn ( pte ) << PAGE_SHIFT ;
970
- pte_unmap_unlock ( ptep , ptl );
965
+ * prot = pgprot_val (args . pgprot );
966
+ * phys = (resource_size_t )args . pfn << PAGE_SHIFT ;
967
+ follow_pfnmap_end ( & args );
971
968
return 0 ;
972
969
}
973
970
You can’t perform that action at this time.
0 commit comments