Linux Kernel
3.7.1
|
#include <linux/export.h>
#include <linux/backing-dev.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/file.h>
#include <linux/mman.h>
#include <linux/pagemap.h>
#include <linux/swapops.h>
#include <linux/rmap.h>
#include <linux/syscalls.h>
#include <linux/mmu_notifier.h>
#include <asm/mmu_context.h>
#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
#include "internal.h"
Go to the source code of this file.
Functions | |
int | generic_file_remap_pages (struct vm_area_struct *vma, unsigned long addr, unsigned long size, pgoff_t pgoff) |
EXPORT_SYMBOL (generic_file_remap_pages) | |
SYSCALL_DEFINE5 (remap_file_pages, unsigned long, start, unsigned long, size, unsigned long, prot, unsigned long, pgoff, unsigned long, flags) | |
EXPORT_SYMBOL | ( | generic_file_remap_pages | ) |
SYSCALL_DEFINE5 | ( | remap_file_pages | , |
unsigned | long, | ||
start | , | ||
unsigned | long, | ||
size | , | ||
unsigned | long, | ||
prot | , | ||
unsigned | long, | ||
pgoff | , | ||
unsigned | long, | ||
flags | |||
) |
sys_remap_file_pages - remap arbitrary pages of an existing VM_SHARED vma : start of the remapped virtual memory range : size of the remapped virtual memory range : new protection bits of the range (see NOTE) : to-be-mapped page of the backing store file : 0 or MAP_NONBLOCKED - the later will cause no IO.
sys_remap_file_pages remaps arbitrary pages of an existing VM_SHARED vma (shared backing store file).
This syscall works purely via pagetables, so it's the most efficient way to map the same (large) file into a given virtual window. Unlike mmap()/mremap() it does not create any new vmas. The new mappings are also safe across swapout.
NOTE: the parameter right now is ignored (but must be zero), and the vma's default protection is used. Arbitrary protections might be implemented in the future.