filemap_fault(9)

filemap_fault9

Read in file data for page fault handling

Usage

int filemap_fault(struct vm_area_struct * vma, struct vm_fault * vmf);

Arguments

vma

vma in which the fault was taken

vmf

struct vm_fault containing details of the fault

Overview

filemap_fault is invoked via the vma operations vector for a mapped memory region to read in file data during a page fault.

The goto's are kind of ugly, but this streamlines the normal case of having it in the page cache, and handles the special cases reasonably without having a lot of duplicated code.

vma->vm_mm->mmap_sem must be held on entry.

If our return value has VM_FAULT_RETRY set, it's because lock_page_or_retry returned 0. The mmap_sem has usually been released in this case. See __lock_page_or_retry for the exception.

If our return value does not have VM_FAULT_RETRY set, the mmap_sem has not been released.

We never return with VM_FAULT_RETRY and a bit from VM_FAULT_ERROR set.

Releases

6 releases since Debian 4.0 (Etch); the text changed 5 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9

From linux-manual-4.9 4.9.228-1 in Debian 9 (Stretch). Parsed by carta from the page's man source.