Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dm-table.c File Reference
#include "dm.h"
#include <linux/module.h>
#include <linux/vmalloc.h>
#include <linux/blkdev.h>
#include <linux/namei.h>
#include <linux/ctype.h>
#include <linux/string.h>
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/atomic.h>

Go to the source code of this file.

Data Structures

struct  dm_table
 

Macros

#define DM_MSG_PREFIX   "table"
 
#define MAX_DEPTH   16
 
#define NODE_SIZE   L1_CACHE_BYTES
 
#define KEYS_PER_NODE   (NODE_SIZE / sizeof(sector_t))
 
#define CHILDREN_PER_NODE   (KEYS_PER_NODE + 1)
 

Functions

voiddm_vcalloc (unsigned long nmemb, unsigned long elem_size)
 
 EXPORT_SYMBOL (dm_vcalloc)
 
int dm_table_create (struct dm_table **result, fmode_t mode, unsigned num_targets, struct mapped_device *md)
 
void dm_table_destroy (struct dm_table *t)
 
void dm_table_get (struct dm_table *t)
 
 EXPORT_SYMBOL (dm_table_get)
 
void dm_table_put (struct dm_table *t)
 
 EXPORT_SYMBOL (dm_table_put)
 
int dm_get_device (struct dm_target *ti, const char *path, fmode_t mode, struct dm_dev **result)
 
 EXPORT_SYMBOL (dm_get_device)
 
int dm_set_device_limits (struct dm_target *ti, struct dm_dev *dev, sector_t start, sector_t len, void *data)
 
 EXPORT_SYMBOL_GPL (dm_set_device_limits)
 
void dm_put_device (struct dm_target *ti, struct dm_dev *d)
 
 EXPORT_SYMBOL (dm_put_device)
 
int dm_split_args (int *argc, char ***argvp, char *input)
 
int dm_table_add_target (struct dm_table *t, const char *type, sector_t start, sector_t len, char *params)
 
int dm_read_arg (struct dm_arg *arg, struct dm_arg_set *arg_set, unsigned *value, char **error)
 
 EXPORT_SYMBOL (dm_read_arg)
 
int dm_read_arg_group (struct dm_arg *arg, struct dm_arg_set *arg_set, unsigned *value, char **error)
 
 EXPORT_SYMBOL (dm_read_arg_group)
 
const chardm_shift_arg (struct dm_arg_set *as)
 
 EXPORT_SYMBOL (dm_shift_arg)
 
void dm_consume_args (struct dm_arg_set *as, unsigned num_args)
 
 EXPORT_SYMBOL (dm_consume_args)
 
unsigned dm_table_get_type (struct dm_table *t)
 
struct target_typedm_table_get_immutable_target_type (struct dm_table *t)
 
bool dm_table_request_based (struct dm_table *t)
 
int dm_table_alloc_md_mempools (struct dm_table *t)
 
void dm_table_free_md_mempools (struct dm_table *t)
 
struct dm_md_mempoolsdm_table_get_md_mempools (struct dm_table *t)
 
int dm_table_complete (struct dm_table *t)
 
void dm_table_event_callback (struct dm_table *t, void(*fn)(void *), void *context)
 
void dm_table_event (struct dm_table *t)
 
 EXPORT_SYMBOL (dm_table_event)
 
sector_t dm_table_get_size (struct dm_table *t)
 
 EXPORT_SYMBOL (dm_table_get_size)
 
struct dm_targetdm_table_get_target (struct dm_table *t, unsigned int index)
 
struct dm_targetdm_table_find_target (struct dm_table *t, sector_t sector)
 
bool dm_table_has_no_data_devices (struct dm_table *table)
 
int dm_calculate_queue_limits (struct dm_table *table, struct queue_limits *limits)
 
void dm_table_set_restrictions (struct dm_table *t, struct request_queue *q, struct queue_limits *limits)
 
unsigned int dm_table_get_num_targets (struct dm_table *t)
 
struct list_headdm_table_get_devices (struct dm_table *t)
 
fmode_t dm_table_get_mode (struct dm_table *t)
 
 EXPORT_SYMBOL (dm_table_get_mode)
 
void dm_table_presuspend_targets (struct dm_table *t)
 
void dm_table_postsuspend_targets (struct dm_table *t)
 
int dm_table_resume_targets (struct dm_table *t)
 
void dm_table_add_target_callbacks (struct dm_table *t, struct dm_target_callbacks *cb)
 
 EXPORT_SYMBOL_GPL (dm_table_add_target_callbacks)
 
int dm_table_any_congested (struct dm_table *t, int bdi_bits)
 
int dm_table_any_busy_target (struct dm_table *t)
 
struct mapped_devicedm_table_get_md (struct dm_table *t)
 
 EXPORT_SYMBOL (dm_table_get_md)
 
bool dm_table_supports_discards (struct dm_table *t)
 

Macro Definition Documentation

#define CHILDREN_PER_NODE   (KEYS_PER_NODE + 1)

Definition at line 27 of file dm-table.c.

#define DM_MSG_PREFIX   "table"

Definition at line 22 of file dm-table.c.

#define KEYS_PER_NODE   (NODE_SIZE / sizeof(sector_t))

Definition at line 26 of file dm-table.c.

#define MAX_DEPTH   16

Definition at line 24 of file dm-table.c.

#define NODE_SIZE   L1_CACHE_BYTES

Definition at line 25 of file dm-table.c.

Function Documentation

int dm_calculate_queue_limits ( struct dm_table table,
struct queue_limits *  limits 
)

Definition at line 1253 of file dm-table.c.

void dm_consume_args ( struct dm_arg_set as,
unsigned  num_args 
)

Definition at line 888 of file dm-table.c.

int dm_get_device ( struct dm_target ti,
const char path,
fmode_t  mode,
struct dm_dev **  result 
)

Definition at line 458 of file dm-table.c.

void dm_put_device ( struct dm_target ti,
struct dm_dev d 
)

Definition at line 555 of file dm-table.c.

int dm_read_arg ( struct dm_arg arg,
struct dm_arg_set arg_set,
unsigned *  value,
char **  error 
)

Definition at line 859 of file dm-table.c.

int dm_read_arg_group ( struct dm_arg arg,
struct dm_arg_set arg_set,
unsigned *  value,
char **  error 
)

Definition at line 866 of file dm-table.c.

int dm_set_device_limits ( struct dm_target ti,
struct dm_dev dev,
sector_t  start,
sector_t  len,
void data 
)

Definition at line 516 of file dm-table.c.

const char* dm_shift_arg ( struct dm_arg_set as)

Definition at line 873 of file dm-table.c.

int dm_split_args ( int argc,
char ***  argvp,
char input 
)

Definition at line 604 of file dm-table.c.

int dm_table_add_target ( struct dm_table t,
const char type,
sector_t  start,
sector_t  len,
char params 
)

Definition at line 738 of file dm-table.c.

void dm_table_add_target_callbacks ( struct dm_table t,
struct dm_target_callbacks cb 
)

Definition at line 1546 of file dm-table.c.

int dm_table_alloc_md_mempools ( struct dm_table t)

Definition at line 967 of file dm-table.c.

int dm_table_any_busy_target ( struct dm_table t)

Definition at line 1578 of file dm-table.c.

int dm_table_any_congested ( struct dm_table t,
int  bdi_bits 
)

Definition at line 1552 of file dm-table.c.

int dm_table_complete ( struct dm_table t)

Definition at line 1124 of file dm-table.c.

int dm_table_create ( struct dm_table **  result,
fmode_t  mode,
unsigned  num_targets,
struct mapped_device md 
)

Definition at line 201 of file dm-table.c.

void dm_table_destroy ( struct dm_table t)

Definition at line 243 of file dm-table.c.

void dm_table_event ( struct dm_table t)

Definition at line 1163 of file dm-table.c.

void dm_table_event_callback ( struct dm_table t,
void(*)(void *)  fn,
void context 
)

Definition at line 1154 of file dm-table.c.

struct dm_target* dm_table_find_target ( struct dm_table t,
sector_t  sector 
)
read

Definition at line 1198 of file dm-table.c.

void dm_table_free_md_mempools ( struct dm_table t)

Definition at line 983 of file dm-table.c.

void dm_table_get ( struct dm_table t)

Definition at line 278 of file dm-table.c.

struct list_head* dm_table_get_devices ( struct dm_table t)
read

Definition at line 1478 of file dm-table.c.

struct target_type* dm_table_get_immutable_target_type ( struct dm_table t)
read

Definition at line 957 of file dm-table.c.

struct mapped_device* dm_table_get_md ( struct dm_table t)
read

Definition at line 1592 of file dm-table.c.

struct dm_md_mempools* dm_table_get_md_mempools ( struct dm_table t)
read

Definition at line 989 of file dm-table.c.

fmode_t dm_table_get_mode ( struct dm_table t)

Definition at line 1483 of file dm-table.c.

unsigned int dm_table_get_num_targets ( struct dm_table t)

Definition at line 1473 of file dm-table.c.

sector_t dm_table_get_size ( struct dm_table t)

Definition at line 1178 of file dm-table.c.

struct dm_target* dm_table_get_target ( struct dm_table t,
unsigned int  index 
)
read

Definition at line 1184 of file dm-table.c.

unsigned dm_table_get_type ( struct dm_table t)

Definition at line 952 of file dm-table.c.

bool dm_table_has_no_data_devices ( struct dm_table table)

Definition at line 1231 of file dm-table.c.

void dm_table_postsuspend_targets ( struct dm_table t)

Definition at line 1513 of file dm-table.c.

void dm_table_presuspend_targets ( struct dm_table t)

Definition at line 1505 of file dm-table.c.

void dm_table_put ( struct dm_table t)

Definition at line 284 of file dm-table.c.

bool dm_table_request_based ( struct dm_table t)

Definition at line 962 of file dm-table.c.

int dm_table_resume_targets ( struct dm_table t)

Definition at line 1521 of file dm-table.c.

void dm_table_set_restrictions ( struct dm_table t,
struct request_queue q,
struct queue_limits *  limits 
)

Definition at line 1417 of file dm-table.c.

bool dm_table_supports_discards ( struct dm_table t)

Definition at line 1606 of file dm-table.c.

void* dm_vcalloc ( unsigned long  nmemb,
unsigned long  elem_size 
)

Definition at line 146 of file dm-table.c.

EXPORT_SYMBOL ( dm_vcalloc  )
EXPORT_SYMBOL ( dm_table_get  )
EXPORT_SYMBOL ( dm_table_put  )
EXPORT_SYMBOL ( dm_get_device  )
EXPORT_SYMBOL ( dm_put_device  )
EXPORT_SYMBOL ( dm_read_arg  )
EXPORT_SYMBOL ( dm_read_arg_group  )
EXPORT_SYMBOL ( dm_shift_arg  )
EXPORT_SYMBOL ( dm_consume_args  )
EXPORT_SYMBOL ( dm_table_event  )
EXPORT_SYMBOL ( dm_table_get_size  )
EXPORT_SYMBOL ( dm_table_get_mode  )
EXPORT_SYMBOL ( dm_table_get_md  )
EXPORT_SYMBOL_GPL ( dm_set_device_limits  )
EXPORT_SYMBOL_GPL ( dm_table_add_target_callbacks  )