Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions
zcache-main.c File Reference
#include <linux/module.h>
#include <linux/cpu.h>
#include <linux/highmem.h>
#include <linux/list.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/types.h>
#include <linux/atomic.h>
#include <linux/math64.h>
#include <linux/crypto.h>
#include <linux/cleancache.h>
#include <linux/frontswap.h>
#include "tmem.h"
#include "zcache.h"
#include "zbud.h"
#include "ramster.h"

Go to the source code of this file.

Macros

#define ramster_enabled   0
 
#define ZCACHE_GFP_MASK   (__GFP_FS | __GFP_NORETRY | __GFP_NOWARN | __GFP_NOMEMALLOC)
 
#define ZCACHE_COMP_NAME_SZ   CRYPTO_MAX_ALG_NAME
 
#define ZCACHE_DEBUG
 
#define ZCACHE_DSTMEM_ORDER   1
 
#define SWIZ_BITS   8
 
#define SWIZ_MASK   ((1 << SWIZ_BITS) - 1)
 
#define _oswiz(_type, _ind)   ((_type << SWIZ_BITS) | (_ind & SWIZ_MASK))
 
#define iswiz(_ind)   (_ind >> SWIZ_BITS)
 

Enumerations

enum  comp_op { ZCACHE_COMPOP_COMPRESS, ZCACHE_COMPOP_DECOMPRESS, ZCACHE_COMPOP_COMPRESS, ZCACHE_COMPOP_DECOMPRESS }
 

Functions

 MODULE_LICENSE ("GPL")
 
void zcache_dump (void)
 
struct tmem_poolzcache_get_pool_by_id (uint16_t cli_id, uint16_t poolid)
 
void zcache_put_pool (struct tmem_pool *pool)
 
int zcache_new_client (uint16_t cli_id)
 
voidzcache_pampd_create (char *data, unsigned int size, bool raw, int eph, struct tmem_handle *th)
 
void zcache_pampd_create_finish (void *pampd, bool eph)
 
void zcache_decompress_to_page (char *from_va, unsigned int size, struct page *to_page)
 
int zcache_put_page (int cli_id, int pool_id, struct tmem_oid *oidp, uint32_t index, void *page, unsigned int size, bool raw, int ephemeral)
 
int zcache_get_page (int cli_id, int pool_id, struct tmem_oid *oidp, uint32_t index, void *page, size_t *sizep, bool raw, int get_and_free)
 
int zcache_flush_page (int cli_id, int pool_id, struct tmem_oid *oidp, uint32_t index)
 
int zcache_flush_object (int cli_id, int pool_id, struct tmem_oid *oidp)
 
int zcache_new_pool (uint16_t cli_id, uint32_t flags)
 
int zcache_autocreate_pool (unsigned int cli_id, unsigned int pool_id, bool eph)
 
struct cleancache_ops zcache_cleancache_register_ops (void)
 
struct frontswap_ops zcache_frontswap_register_ops (void)
 
 __setup ("zcache", enable_zcache)
 
 __setup ("ramster", enable_ramster)
 
 __setup ("nocleancache", no_cleancache)
 
 __setup ("nofrontswap", no_frontswap)
 
 __setup ("nofrontswapexclusivegets", no_frontswap_exclusive_gets)
 
 __setup ("nofrontswapignorenonactive", no_frontswap_ignore_nonactive)
 
 __setup ("nocleancacheignorenonactive", no_cleancache_ignore_nonactive)
 
 __setup ("zcache=", enable_zcache_compressor)
 
 late_initcall (zcache_init)
 

Macro Definition Documentation

#define _oswiz (   _type,
  _ind 
)    ((_type << SWIZ_BITS) | (_ind & SWIZ_MASK))

Definition at line 1517 of file zcache-main.c.

#define iswiz (   _ind)    (_ind >> SWIZ_BITS)

Definition at line 1518 of file zcache-main.c.

#define ramster_enabled   0

Definition at line 35 of file zcache-main.c.

#define SWIZ_BITS   8

Definition at line 1515 of file zcache-main.c.

#define SWIZ_MASK   ((1 << SWIZ_BITS) - 1)

Definition at line 1516 of file zcache-main.c.

#define ZCACHE_COMP_NAME_SZ   CRYPTO_MAX_ALG_NAME

Definition at line 71 of file zcache-main.c.

#define ZCACHE_DEBUG

Definition at line 248 of file zcache-main.c.

#define ZCACHE_DSTMEM_ORDER   1

Definition at line 856 of file zcache-main.c.

#define ZCACHE_GFP_MASK   (__GFP_FS | __GFP_NORETRY | __GFP_NOWARN | __GFP_NOMEMALLOC)

Definition at line 65 of file zcache-main.c.

Enumeration Type Documentation

enum comp_op
Enumerator:
ZCACHE_COMPOP_COMPRESS 
ZCACHE_COMPOP_DECOMPRESS 
ZCACHE_COMPOP_COMPRESS 
ZCACHE_COMPOP_DECOMPRESS 

Definition at line 75 of file zcache-main.c.

Function Documentation

__setup ( "zcache"  ,
enable_zcache   
)
__setup ( "ramster"  ,
enable_ramster   
)
__setup ( "nocleancache"  ,
no_cleancache   
)
__setup ( "nofrontswap"  ,
no_frontswap   
)
__setup ( "nofrontswapexclusivegets"  ,
no_frontswap_exclusive_gets   
)
__setup ( "nofrontswapignorenonactive"  ,
no_frontswap_ignore_nonactive   
)
__setup ( "nocleancacheignorenonactive"  ,
no_cleancache_ignore_nonactive   
)
__setup ( )
late_initcall ( zcache_init  )
MODULE_LICENSE ( "GPL"  )
int zcache_autocreate_pool ( unsigned int  cli_id,
unsigned int  pool_id,
bool  eph 
)

Definition at line 1346 of file zcache-main.c.

struct cleancache_ops zcache_cleancache_register_ops ( void  )
read

Definition at line 1498 of file zcache-main.c.

void zcache_decompress_to_page ( char from_va,
unsigned int  size,
struct page to_page 
)

Definition at line 715 of file zcache-main.c.

void zcache_dump ( void  )

Definition at line 251 of file zcache-main.c.

int zcache_flush_object ( int  cli_id,
int  pool_id,
struct tmem_oid oidp 
)

Definition at line 1235 of file zcache-main.c.

int zcache_flush_page ( int  cli_id,
int  pool_id,
struct tmem_oid oidp,
uint32_t  index 
)

Definition at line 1212 of file zcache-main.c.

struct frontswap_ops zcache_frontswap_register_ops ( void  )
read

Definition at line 1629 of file zcache-main.c.

int zcache_get_page ( int  cli_id,
int  pool_id,
struct tmem_oid oidp,
uint32_t  index,
void page,
size_t sizep,
bool  raw,
int  get_and_free 
)

Definition at line 1182 of file zcache-main.c.

static struct tmem_pool * zcache_get_pool_by_id ( uint16_t  cli_id,
uint16_t  poolid 
)
read

Definition at line 331 of file zcache-main.c.

int zcache_new_client ( uint16_t  cli_id)

Definition at line 362 of file zcache-main.c.

int zcache_new_pool ( uint16_t  cli_id,
uint32_t  flags 
)

Definition at line 1294 of file zcache-main.c.

void* zcache_pampd_create ( char data,
unsigned int  size,
bool  raw,
int  eph,
struct tmem_handle th 
)

Definition at line 639 of file zcache-main.c.

void zcache_pampd_create_finish ( void pampd,
bool  eph 
)

Definition at line 690 of file zcache-main.c.

int zcache_put_page ( int  cli_id,
int  pool_id,
struct tmem_oid oidp,
uint32_t  index,
void page,
unsigned int  size,
bool  raw,
int  ephemeral 
)

Definition at line 1134 of file zcache-main.c.

static void zcache_put_pool ( struct tmem_pool pool)

Definition at line 350 of file zcache-main.c.