Lines Matching refs:vmf
76 static void dax_set_mapping(struct vm_fault *vmf, pfn_t pfn, in dax_set_mapping() argument
80 struct file *filp = vmf->vma->vm_file; in dax_set_mapping()
88 pgoff = linear_page_index(vmf->vma, in dax_set_mapping()
89 ALIGN(vmf->address, fault_size)); in dax_set_mapping()
104 struct vm_fault *vmf) in __dev_dax_pte_fault() argument
111 if (check_vma(dev_dax, vmf->vma, __func__)) in __dev_dax_pte_fault()
123 phys = dax_pgoff_to_phys(dev_dax, vmf->pgoff, PAGE_SIZE); in __dev_dax_pte_fault()
125 dev_dbg(dev, "pgoff_to_phys(%#lx) failed\n", vmf->pgoff); in __dev_dax_pte_fault()
131 dax_set_mapping(vmf, pfn, fault_size); in __dev_dax_pte_fault()
133 return vmf_insert_mixed(vmf->vma, vmf->address, pfn); in __dev_dax_pte_fault()
137 struct vm_fault *vmf) in __dev_dax_pmd_fault() argument
139 unsigned long pmd_addr = vmf->address & PMD_MASK; in __dev_dax_pmd_fault()
146 if (check_vma(dev_dax, vmf->vma, __func__)) in __dev_dax_pmd_fault()
161 if (pmd_addr < vmf->vma->vm_start || in __dev_dax_pmd_fault()
162 (pmd_addr + PMD_SIZE) > vmf->vma->vm_end) in __dev_dax_pmd_fault()
165 pgoff = linear_page_index(vmf->vma, pmd_addr); in __dev_dax_pmd_fault()
174 dax_set_mapping(vmf, pfn, fault_size); in __dev_dax_pmd_fault()
176 return vmf_insert_pfn_pmd(vmf, pfn, vmf->flags & FAULT_FLAG_WRITE); in __dev_dax_pmd_fault()
181 struct vm_fault *vmf) in __dev_dax_pud_fault() argument
183 unsigned long pud_addr = vmf->address & PUD_MASK; in __dev_dax_pud_fault()
191 if (check_vma(dev_dax, vmf->vma, __func__)) in __dev_dax_pud_fault()
206 if (pud_addr < vmf->vma->vm_start || in __dev_dax_pud_fault()
207 (pud_addr + PUD_SIZE) > vmf->vma->vm_end) in __dev_dax_pud_fault()
210 pgoff = linear_page_index(vmf->vma, pud_addr); in __dev_dax_pud_fault()
219 dax_set_mapping(vmf, pfn, fault_size); in __dev_dax_pud_fault()
221 return vmf_insert_pfn_pud(vmf, pfn, vmf->flags & FAULT_FLAG_WRITE); in __dev_dax_pud_fault()
225 struct vm_fault *vmf) in __dev_dax_pud_fault() argument
231 static vm_fault_t dev_dax_huge_fault(struct vm_fault *vmf, unsigned int order) in dev_dax_huge_fault() argument
233 struct file *filp = vmf->vma->vm_file; in dev_dax_huge_fault()
239 (vmf->flags & FAULT_FLAG_WRITE) ? "write" : "read", in dev_dax_huge_fault()
240 vmf->vma->vm_start, vmf->vma->vm_end, order); in dev_dax_huge_fault()
244 rc = __dev_dax_pte_fault(dev_dax, vmf); in dev_dax_huge_fault()
246 rc = __dev_dax_pmd_fault(dev_dax, vmf); in dev_dax_huge_fault()
248 rc = __dev_dax_pud_fault(dev_dax, vmf); in dev_dax_huge_fault()
257 static vm_fault_t dev_dax_fault(struct vm_fault *vmf) in dev_dax_fault() argument
259 return dev_dax_huge_fault(vmf, 0); in dev_dax_fault()