Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
zbud.c File Reference
#include <linux/module.h>
#include <linux/highmem.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/pagemap.h>
#include <linux/atomic.h>
#include <linux/bug.h>
#include "tmem.h"
#include "zcache.h"
#include "zbud.h"

Go to the source code of this file.

Data Structures

struct  zbudpage
 
struct  zbudref
 
struct  zbud_unbuddied
 

Macros

#define CHUNK_SHIFT   6
 
#define CHUNK_SIZE   (1 << CHUNK_SHIFT)
 
#define CHUNK_MASK   (~(CHUNK_SIZE-1))
 
#define NCHUNKS   (PAGE_SIZE >> CHUNK_SHIFT)
 
#define MAX_CHUNK   (NCHUNKS-1)
 

Functions

unsigned int zbud_max_buddy_size (void)
 
struct pagezbud_free_and_delist (struct zbudref *zref, bool eph, unsigned int *zsize, unsigned int *zpages)
 
struct zbudrefzbud_match_prep (struct tmem_handle *th, bool eph, void *cdata, unsigned size)
 
struct zbudrefzbud_create_prep (struct tmem_handle *th, bool eph, void *cdata, unsigned size, struct page *newpage)
 
void zbud_create_finish (struct zbudref *zref, bool eph)
 
int zbud_decompress (struct page *data_page, struct zbudref *zref, bool eph, void(*decompress)(char *, unsigned int, char *))
 
int zbud_copy_from_zbud (char *to_va, struct zbudref *zref, size_t *sizep, bool eph)
 
int zbud_copy_to_zbud (struct zbudref *zref, char *from_va, bool eph)
 
struct pagezbud_evict_pageframe_lru (unsigned int *zsize, unsigned int *zpages)
 
unsigned int zbud_make_zombie_lru (struct tmem_handle *th, unsigned char **data, unsigned int *zsize, bool eph)
 
void __init zbud_init (void)
 

Macro Definition Documentation

#define CHUNK_MASK   (~(CHUNK_SIZE-1))

Definition at line 125 of file zbud.c.

#define CHUNK_SHIFT   6

Definition at line 123 of file zbud.c.

#define CHUNK_SIZE   (1 << CHUNK_SHIFT)

Definition at line 124 of file zbud.c.

#define MAX_CHUNK   (NCHUNKS-1)

Definition at line 127 of file zbud.c.

#define NCHUNKS   (PAGE_SIZE >> CHUNK_SHIFT)

Definition at line 126 of file zbud.c.

Function Documentation

int zbud_copy_from_zbud ( char to_va,
struct zbudref zref,
size_t sizep,
bool  eph 
)

Definition at line 803 of file zbud.c.

int zbud_copy_to_zbud ( struct zbudref zref,
char from_va,
bool  eph 
)

Definition at line 845 of file zbud.c.

void zbud_create_finish ( struct zbudref zref,
bool  eph 
)

Definition at line 741 of file zbud.c.

struct zbudref* zbud_create_prep ( struct tmem_handle th,
bool  eph,
void cdata,
unsigned  size,
struct page newpage 
)
read

Definition at line 692 of file zbud.c.

int zbud_decompress ( struct page data_page,
struct zbudref zref,
bool  eph,
void(*)(char *, unsigned int, char *)  decompress 
)

Definition at line 761 of file zbud.c.

struct page* zbud_evict_pageframe_lru ( unsigned int zsize,
unsigned int zpages 
)
read

Definition at line 887 of file zbud.c.

struct page* zbud_free_and_delist ( struct zbudref zref,
bool  eph,
unsigned int zsize,
unsigned int zpages 
)
read

Definition at line 539 of file zbud.c.

void __init zbud_init ( void  )

Definition at line 1047 of file zbud.c.

unsigned int zbud_make_zombie_lru ( struct tmem_handle th,
unsigned char **  data,
unsigned int zsize,
bool  eph 
)

Definition at line 975 of file zbud.c.

struct zbudref* zbud_match_prep ( struct tmem_handle th,
bool  eph,
void cdata,
unsigned  size 
)
read

Definition at line 622 of file zbud.c.

unsigned int zbud_max_buddy_size ( void  )

Definition at line 529 of file zbud.c.