table of contents
FILEMAP_FAULT(9) | Memory Management in Linux | FILEMAP_FAULT(9) |
NAME¶
filemap_fault - read in file data for page fault handling
SYNOPSIS¶
int filemap_fault(struct vm_fault * vmf);
ARGUMENTS¶
struct vm_fault * vmf
DESCRIPTION¶
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.
COPYRIGHT¶
June 2017 | Kernel Hackers Manual 4.11 |