Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
mmap.c File Reference
#include <linux/slab.h>
#include <linux/backing-dev.h>
#include <linux/mm.h>
#include <linux/shm.h>
#include <linux/mman.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
#include <linux/syscalls.h>
#include <linux/capability.h>
#include <linux/init.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/personality.h>
#include <linux/security.h>
#include <linux/hugetlb.h>
#include <linux/profile.h>
#include <linux/export.h>
#include <linux/mount.h>
#include <linux/mempolicy.h>
#include <linux/rmap.h>
#include <linux/mmu_notifier.h>
#include <linux/perf_event.h>
#include <linux/audit.h>
#include <linux/khugepaged.h>
#include <linux/uprobes.h>
#include <asm/uaccess.h>
#include <asm/cacheflush.h>
#include <asm/tlb.h>
#include <asm/mmu_context.h>
#include "internal.h"

Go to the source code of this file.

Macros

#define arch_mmap_check(addr, len, flags)   (0)
 
#define arch_rebalance_pgtables(addr, len)   (addr)
 
#define validate_mm(mm)   do { } while (0)
 

Functions

pgprot_t vm_get_page_prot (unsigned long vm_flags)
 
 EXPORT_SYMBOL (vm_get_page_prot)
 
int __vm_enough_memory (struct mm_struct *mm, long pages, int cap_sys_admin)
 
void unlink_file_vma (struct vm_area_struct *vma)
 
 SYSCALL_DEFINE1 (brk, unsigned long, brk)
 
void __vma_link_rb (struct mm_struct *mm, struct vm_area_struct *vma, struct rb_node **rb_link, struct rb_node *rb_parent)
 
int vma_adjust (struct vm_area_struct *vma, unsigned long start, unsigned long end, pgoff_t pgoff, struct vm_area_struct *insert)
 
struct vm_area_structvma_merge (struct mm_struct *mm, struct vm_area_struct *prev, unsigned long addr, unsigned long end, unsigned long vm_flags, struct anon_vma *anon_vma, struct file *file, pgoff_t pgoff, struct mempolicy *policy)
 
struct anon_vmafind_mergeable_anon_vma (struct vm_area_struct *vma)
 
unsigned long do_mmap_pgoff (struct file *file, unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long pgoff)
 
 SYSCALL_DEFINE6 (mmap_pgoff, unsigned long, addr, unsigned long, len, unsigned long, prot, unsigned long, flags, unsigned long, fd, unsigned long, pgoff)
 
int vma_wants_writenotify (struct vm_area_struct *vma)
 
unsigned long mmap_region (struct file *file, unsigned long addr, unsigned long len, unsigned long flags, vm_flags_t vm_flags, unsigned long pgoff)
 
unsigned long arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)
 
void arch_unmap_area (struct mm_struct *mm, unsigned long addr)
 
unsigned long arch_get_unmapped_area_topdown (struct file *filp, const unsigned long addr0, const unsigned long len, const unsigned long pgoff, const unsigned long flags)
 
void arch_unmap_area_topdown (struct mm_struct *mm, unsigned long addr)
 
unsigned long get_unmapped_area (struct file *file, unsigned long addr, unsigned long len, unsigned long pgoff, unsigned long flags)
 
 EXPORT_SYMBOL (get_unmapped_area)
 
struct vm_area_structfind_vma (struct mm_struct *mm, unsigned long addr)
 
 EXPORT_SYMBOL (find_vma)
 
struct vm_area_structfind_vma_prev (struct mm_struct *mm, unsigned long addr, struct vm_area_struct **pprev)
 
int expand_downwards (struct vm_area_struct *vma, unsigned long address)
 
int expand_stack (struct vm_area_struct *vma, unsigned long address)
 
struct vm_area_structfind_extend_vma (struct mm_struct *mm, unsigned long addr)
 
int split_vma (struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, int new_below)
 
int do_munmap (struct mm_struct *mm, unsigned long start, size_t len)
 
int vm_munmap (unsigned long start, size_t len)
 
 EXPORT_SYMBOL (vm_munmap)
 
 SYSCALL_DEFINE2 (munmap, unsigned long, addr, size_t, len)
 
unsigned long vm_brk (unsigned long addr, unsigned long len)
 
 EXPORT_SYMBOL (vm_brk)
 
void exit_mmap (struct mm_struct *mm)
 
int insert_vm_struct (struct mm_struct *mm, struct vm_area_struct *vma)
 
struct vm_area_structcopy_vma (struct vm_area_struct **vmap, unsigned long addr, unsigned long len, pgoff_t pgoff, bool *need_rmap_locks)
 
int may_expand_vm (struct mm_struct *mm, unsigned long npages)
 
int install_special_mapping (struct mm_struct *mm, unsigned long addr, unsigned long len, unsigned long vm_flags, struct page **pages)
 
int mm_take_all_locks (struct mm_struct *mm)
 
void mm_drop_all_locks (struct mm_struct *mm)
 
void __init mmap_init (void)
 

Variables

pgprot_t protection_map [16]
 
int sysctl_overcommit_memory __read_mostly = OVERCOMMIT_GUESS
 
struct percpu_counter
vm_committed_as 
____cacheline_aligned_in_smp
 

Macro Definition Documentation

#define arch_mmap_check (   addr,
  len,
  flags 
)    (0)

Definition at line 43 of file mmap.c.

#define arch_rebalance_pgtables (   addr,
  len 
)    (addr)

Definition at line 47 of file mmap.c.

#define validate_mm (   mm)    do { } while (0)

Definition at line 352 of file mmap.c.

Function Documentation

int __vm_enough_memory ( struct mm_struct mm,
long  pages,
int  cap_sys_admin 
)

Definition at line 107 of file mmap.c.

void __vma_link_rb ( struct mm_struct mm,
struct vm_area_struct vma,
struct rb_node **  rb_link,
struct rb_node rb_parent 
)

Definition at line 421 of file mmap.c.

unsigned long arch_get_unmapped_area ( struct file filp,
unsigned long  addr,
unsigned long  len,
unsigned long  pgoff,
unsigned long  flags 
)

Definition at line 1416 of file mmap.c.

unsigned long arch_get_unmapped_area_topdown ( struct file filp,
const unsigned long  addr0,
const unsigned long  len,
const unsigned long  pgoff,
const unsigned long  flags 
)

Definition at line 1488 of file mmap.c.

void arch_unmap_area ( struct mm_struct mm,
unsigned long  addr 
)

Definition at line 1473 of file mmap.c.

void arch_unmap_area_topdown ( struct mm_struct mm,
unsigned long  addr 
)

Definition at line 1579 of file mmap.c.

struct vm_area_struct* copy_vma ( struct vm_area_struct **  vmap,
unsigned long  addr,
unsigned long  len,
pgoff_t  pgoff,
bool need_rmap_locks 
)
read

Definition at line 2375 of file mmap.c.

unsigned long do_mmap_pgoff ( struct file file,
unsigned long  addr,
unsigned long  len,
unsigned long  prot,
unsigned long  flags,
unsigned long  pgoff 
)

Definition at line 1002 of file mmap.c.

int do_munmap ( struct mm_struct mm,
unsigned long  start,
size_t  len 
)

Definition at line 2068 of file mmap.c.

void exit_mmap ( struct mm_struct mm)

Definition at line 2287 of file mmap.c.

int expand_downwards ( struct vm_area_struct vma,
unsigned long  address 
)

Definition at line 1800 of file mmap.c.

int expand_stack ( struct vm_area_struct vma,
unsigned long  address 
)

Definition at line 1873 of file mmap.c.

EXPORT_SYMBOL ( vm_get_page_prot  )
EXPORT_SYMBOL ( get_unmapped_area  )
EXPORT_SYMBOL ( find_vma  )
EXPORT_SYMBOL ( vm_munmap  )
EXPORT_SYMBOL ( vm_brk  )
struct vm_area_struct* find_extend_vma ( struct mm_struct mm,
unsigned long  addr 
)
read

Definition at line 1879 of file mmap.c.

struct anon_vma* find_mergeable_anon_vma ( struct vm_area_struct vma)
read

Definition at line 935 of file mmap.c.

struct vm_area_struct* find_vma ( struct mm_struct mm,
unsigned long  addr 
)
read

Definition at line 1627 of file mmap.c.

struct vm_area_struct* find_vma_prev ( struct mm_struct mm,
unsigned long  addr,
struct vm_area_struct **  pprev 
)
read

Definition at line 1669 of file mmap.c.

unsigned long get_unmapped_area ( struct file file,
unsigned long  addr,
unsigned long  len,
unsigned long  pgoff,
unsigned long  flags 
)

Definition at line 1593 of file mmap.c.

int insert_vm_struct ( struct mm_struct mm,
struct vm_area_struct vma 
)

Definition at line 2339 of file mmap.c.

int install_special_mapping ( struct mm_struct mm,
unsigned long  addr,
unsigned long  len,
unsigned long  vm_flags,
struct page **  pages 
)

Definition at line 2518 of file mmap.c.

int may_expand_vm ( struct mm_struct mm,
unsigned long  npages 
)

Definition at line 2457 of file mmap.c.

void mm_drop_all_locks ( struct mm_struct mm)

Definition at line 2701 of file mmap.c.

int mm_take_all_locks ( struct mm_struct mm)

Definition at line 2630 of file mmap.c.

void __init mmap_init ( void  )

Definition at line 2723 of file mmap.c.

unsigned long mmap_region ( struct file file,
unsigned long  addr,
unsigned long  len,
unsigned long  flags,
vm_flags_t  vm_flags,
unsigned long  pgoff 
)

Definition at line 1243 of file mmap.c.

int split_vma ( struct mm_struct mm,
struct vm_area_struct vma,
unsigned long  addr,
int  new_below 
)

Definition at line 2054 of file mmap.c.

SYSCALL_DEFINE1 ( brk  ,
unsigned  long,
brk   
)

Definition at line 237 of file mmap.c.

SYSCALL_DEFINE2 ( munmap  ,
unsigned  long,
addr  ,
size_t  ,
len   
)

Definition at line 2162 of file mmap.c.

SYSCALL_DEFINE6 ( mmap_pgoff  ,
unsigned  long,
addr  ,
unsigned  long,
len  ,
unsigned  long,
prot  ,
unsigned  long,
flags  ,
unsigned  long,
fd  ,
unsigned  long,
pgoff   
)

Definition at line 1133 of file mmap.c.

void unlink_file_vma ( struct vm_area_struct vma)

Definition at line 206 of file mmap.c.

unsigned long vm_brk ( unsigned long  addr,
unsigned long  len 
)

Definition at line 2274 of file mmap.c.

pgprot_t vm_get_page_prot ( unsigned long  vm_flags)

Definition at line 74 of file mmap.c.

int vm_munmap ( unsigned long  start,
size_t  len 
)

Definition at line 2150 of file mmap.c.

int vma_adjust ( struct vm_area_struct vma,
unsigned long  start,
unsigned long  end,
pgoff_t  pgoff,
struct vm_area_struct insert 
)

Definition at line 518 of file mmap.c.

struct vm_area_struct* vma_merge ( struct mm_struct mm,
struct vm_area_struct prev,
unsigned long  addr,
unsigned long  end,
unsigned long  vm_flags,
struct anon_vma anon_vma,
struct file file,
pgoff_t  pgoff,
struct mempolicy policy 
)
read

Definition at line 797 of file mmap.c.

int vma_wants_writenotify ( struct vm_area_struct vma)

Definition at line 1201 of file mmap.c.

Variable Documentation

struct percpu_counter vm_committed_as ____cacheline_aligned_in_smp

Definition at line 89 of file mmap.c.

Definition at line 82 of file mmap.c.

pgprot_t protection_map[16]
Initial value:

Definition at line 69 of file mmap.c.