Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
swapfile.c File Reference
#include <linux/mm.h>
#include <linux/hugetlb.h>
#include <linux/mman.h>
#include <linux/slab.h>
#include <linux/kernel_stat.h>
#include <linux/swap.h>
#include <linux/vmalloc.h>
#include <linux/pagemap.h>
#include <linux/namei.h>
#include <linux/shmem_fs.h>
#include <linux/blkdev.h>
#include <linux/random.h>
#include <linux/writeback.h>
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
#include <linux/init.h>
#include <linux/ksm.h>
#include <linux/rmap.h>
#include <linux/security.h>
#include <linux/backing-dev.h>
#include <linux/mutex.h>
#include <linux/capability.h>
#include <linux/syscalls.h>
#include <linux/memcontrol.h>
#include <linux/poll.h>
#include <linux/oom.h>
#include <linux/frontswap.h>
#include <linux/swapfile.h>
#include <linux/export.h>
#include <asm/pgtable.h>
#include <asm/tlbflush.h>
#include <linux/swapops.h>
#include <linux/page_cgroup.h>

Go to the source code of this file.

Macros

#define SWAPFILE_CLUSTER   256
 
#define LATENCY_LIMIT   256
 

Functions

 DEFINE_SPINLOCK (swap_lock)
 
swp_entry_t get_swap_page (void)
 
swp_entry_t get_swap_page_of_type (int type)
 
void swap_free (swp_entry_t entry)
 
void swapcache_free (swp_entry_t entry, struct page *page)
 
int page_swapcount (struct page *page)
 
int reuse_swap_page (struct page *page)
 
int try_to_free_swap (struct page *page)
 
int free_swap_and_cache (swp_entry_t entry)
 
int try_to_unuse (unsigned int type, bool frontswap, unsigned long pages_to_unuse)
 
sector_t map_swap_page (struct page *page, struct block_device **bdev)
 
int add_swap_extent (struct swap_info_struct *sis, unsigned long start_page, unsigned long nr_pages, sector_t start_block)
 
 SYSCALL_DEFINE1 (swapoff, const char __user *, specialfile)
 
 SYSCALL_DEFINE2 (swapon, const char __user *, specialfile, int, swap_flags)
 
void si_swapinfo (struct sysinfo *val)
 
void swap_shmem_alloc (swp_entry_t entry)
 
int swap_duplicate (swp_entry_t entry)
 
int swapcache_prepare (swp_entry_t entry)
 
struct swap_info_struct * page_swap_info (struct page *page)
 
struct address_space__page_file_mapping (struct page *page)
 
 EXPORT_SYMBOL_GPL (__page_file_mapping)
 
pgoff_t __page_file_index (struct page *page)
 
 EXPORT_SYMBOL_GPL (__page_file_index)
 
int add_swap_count_continuation (swp_entry_t entry, gfp_t gfp_mask)
 

Variables

long nr_swap_pages
 
long total_swap_pages
 
struct swap_list_t swap_list = {-1, -1}
 
struct swap_info_struct * swap_info [MAX_SWAPFILES]
 

Macro Definition Documentation

#define LATENCY_LIMIT   256

Definition at line 183 of file swapfile.c.

#define SWAPFILE_CLUSTER   256

Definition at line 182 of file swapfile.c.

Function Documentation

pgoff_t __page_file_index ( struct page page)

Definition at line 2244 of file swapfile.c.

struct address_space* __page_file_mapping ( struct page page)
read

Definition at line 2237 of file swapfile.c.

int add_swap_count_continuation ( swp_entry_t  entry,
gfp_t  gfp_mask 
)

Definition at line 2267 of file swapfile.c.

int add_swap_extent ( struct swap_info_struct *  sis,
unsigned long  start_page,
unsigned long  nr_pages,
sector_t  start_block 
)

Definition at line 1350 of file swapfile.c.

DEFINE_SPINLOCK ( swap_lock  )
EXPORT_SYMBOL_GPL ( __page_file_mapping  )
EXPORT_SYMBOL_GPL ( __page_file_index  )
int free_swap_and_cache ( swp_entry_t  entry)

Definition at line 691 of file swapfile.c.

swp_entry_t get_swap_page ( void  )

Definition at line 414 of file swapfile.c.

swp_entry_t get_swap_page_of_type ( int  type)

Definition at line 457 of file swapfile.c.

sector_t map_swap_page ( struct page page,
struct block_device **  bdev 
)

Definition at line 1313 of file swapfile.c.

struct swap_info_struct* page_swap_info ( struct page page)
read

Definition at line 2227 of file swapfile.c.

int page_swapcount ( struct page page)

Definition at line 610 of file swapfile.c.

int reuse_swap_page ( struct page page)

Definition at line 631 of file swapfile.c.

void si_swapinfo ( struct sysinfo val)

Definition at line 2100 of file swapfile.c.

int swap_duplicate ( swp_entry_t  entry)

Definition at line 2205 of file swapfile.c.

void swap_free ( swp_entry_t  entry)

Definition at line 577 of file swapfile.c.

void swap_shmem_alloc ( swp_entry_t  entry)

Definition at line 2193 of file swapfile.c.

void swapcache_free ( swp_entry_t  entry,
struct page page 
)

Definition at line 591 of file swapfile.c.

int swapcache_prepare ( swp_entry_t  entry)

Definition at line 2222 of file swapfile.c.

SYSCALL_DEFINE1 ( swapoff  ,
const char __user ,
specialfile   
)

Definition at line 1479 of file swapfile.c.

SYSCALL_DEFINE2 ( swapon  ,
const char __user ,
specialfile  ,
int  ,
swap_flags   
)

Definition at line 1935 of file swapfile.c.

int try_to_free_swap ( struct page page)

Definition at line 653 of file swapfile.c.

int try_to_unuse ( unsigned int  type,
bool  frontswap,
unsigned long  pages_to_unuse 
)

Definition at line 1045 of file swapfile.c.

Variable Documentation

long nr_swap_pages

Definition at line 50 of file swapfile.c.

struct swap_info_struct* swap_info[MAX_SWAPFILES]

Definition at line 61 of file swapfile.c.

struct swap_list_t swap_list = {-1, -1}

Definition at line 59 of file swapfile.c.

long total_swap_pages

Definition at line 51 of file swapfile.c.