Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dm.c File Reference
#include "dm.h"
#include "dm-uevent.h"
#include <linux/init.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/moduleparam.h>
#include <linux/blkpg.h>
#include <linux/bio.h>
#include <linux/mempool.h>
#include <linux/slab.h>
#include <linux/idr.h>
#include <linux/hdreg.h>
#include <linux/delay.h>
#include <trace/events/block.h>

Go to the source code of this file.

Data Structures

struct  dm_io
 
struct  dm_target_io
 
struct  dm_rq_target_io
 
struct  dm_rq_clone_bio_info
 
struct  mapped_device
 
struct  dm_md_mempools
 
struct  clone_info
 

Macros

#define DM_MSG_PREFIX   "core"
 
#define DM_COOKIE_ENV_VAR_NAME   "DM_COOKIE"
 
#define DM_COOKIE_LENGTH   24
 
#define MINOR_ALLOCED   ((void *)-1)
 
#define DMF_BLOCK_IO_FOR_SUSPEND   0
 
#define DMF_SUSPENDED   1
 
#define DMF_FROZEN   2
 
#define DMF_FREEING   3
 
#define DMF_DELETING   4
 
#define DMF_NOFLUSH_SUSPENDING   5
 
#define DMF_MERGE_IS_OPTIONAL   6
 
#define MIN_IOS   256
 

Functions

union map_infodm_get_mapinfo (struct bio *bio)
 
union map_infodm_get_rq_mapinfo (struct request *rq)
 
 EXPORT_SYMBOL_GPL (dm_get_rq_mapinfo)
 
int dm_deleting_md (struct mapped_device *md)
 
int dm_open_count (struct mapped_device *md)
 
int dm_lock_for_deletion (struct mapped_device *md)
 
struct dm_tabledm_get_live_table (struct mapped_device *md)
 
int dm_get_geometry (struct mapped_device *md, struct hd_geometry *geo)
 
int dm_set_geometry (struct mapped_device *md, struct hd_geometry *geo)
 
void dm_requeue_unmapped_request (struct request *clone)
 
 EXPORT_SYMBOL_GPL (dm_requeue_unmapped_request)
 
void dm_kill_unmapped_request (struct request *clone, int error)
 
 EXPORT_SYMBOL_GPL (dm_kill_unmapped_request)
 
int dm_set_target_max_io_len (struct dm_target *ti, sector_t len)
 
 EXPORT_SYMBOL_GPL (dm_set_target_max_io_len)
 
void dm_dispatch_request (struct request *rq)
 
 EXPORT_SYMBOL_GPL (dm_dispatch_request)
 
int dm_underlying_device_busy (struct request_queue *q)
 
 EXPORT_SYMBOL_GPL (dm_underlying_device_busy)
 
int dm_queue_merge_is_compulsory (struct request_queue *q)
 
int dm_create (int minor, struct mapped_device **result)
 
void dm_lock_md_type (struct mapped_device *md)
 
void dm_unlock_md_type (struct mapped_device *md)
 
void dm_set_md_type (struct mapped_device *md, unsigned type)
 
unsigned dm_get_md_type (struct mapped_device *md)
 
struct target_typedm_get_immutable_target_type (struct mapped_device *md)
 
int dm_setup_md_queue (struct mapped_device *md)
 
struct mapped_devicedm_get_md (dev_t dev)
 
 EXPORT_SYMBOL_GPL (dm_get_md)
 
voiddm_get_mdptr (struct mapped_device *md)
 
void dm_set_mdptr (struct mapped_device *md, void *ptr)
 
void dm_get (struct mapped_device *md)
 
const chardm_device_name (struct mapped_device *md)
 
 EXPORT_SYMBOL_GPL (dm_device_name)
 
void dm_destroy (struct mapped_device *md)
 
void dm_destroy_immediate (struct mapped_device *md)
 
void dm_put (struct mapped_device *md)
 
 EXPORT_SYMBOL_GPL (dm_put)
 
struct dm_tabledm_swap_table (struct mapped_device *md, struct dm_table *table)
 
int dm_suspend (struct mapped_device *md, unsigned suspend_flags)
 
int dm_resume (struct mapped_device *md)
 
int dm_kobject_uevent (struct mapped_device *md, enum kobject_action action, unsigned cookie)
 
uint32_t dm_next_uevent_seq (struct mapped_device *md)
 
uint32_t dm_get_event_nr (struct mapped_device *md)
 
int dm_wait_event (struct mapped_device *md, int event_nr)
 
void dm_uevent_add (struct mapped_device *md, struct list_head *elist)
 
struct gendisk * dm_disk (struct mapped_device *md)
 
struct kobjectdm_kobject (struct mapped_device *md)
 
struct mapped_devicedm_get_from_kobject (struct kobject *kobj)
 
int dm_suspended_md (struct mapped_device *md)
 
int dm_suspended (struct dm_target *ti)
 
 EXPORT_SYMBOL_GPL (dm_suspended)
 
int dm_noflush_suspending (struct dm_target *ti)
 
 EXPORT_SYMBOL_GPL (dm_noflush_suspending)
 
struct dm_md_mempoolsdm_alloc_md_mempools (unsigned type, unsigned integrity)
 
void dm_free_md_mempools (struct dm_md_mempools *pools)
 
 EXPORT_SYMBOL (dm_get_mapinfo)
 
 module_init (dm_init)
 
 module_exit (dm_exit)
 
 module_param (major, uint, 0)
 
 MODULE_PARM_DESC (major,"The major number of the device mapper")
 
 MODULE_DESCRIPTION (DM_NAME" driver")
 
 MODULE_AUTHOR ("Joe Thornber <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DM_COOKIE_ENV_VAR_NAME   "DM_COOKIE"

Definition at line 41 of file dm.c.

#define DM_COOKIE_LENGTH   24

Definition at line 42 of file dm.c.

#define DM_MSG_PREFIX   "core"

Definition at line 25 of file dm.c.

#define DMF_BLOCK_IO_FOR_SUSPEND   0

Definition at line 123 of file dm.c.

#define DMF_DELETING   4

Definition at line 127 of file dm.c.

#define DMF_FREEING   3

Definition at line 126 of file dm.c.

#define DMF_FROZEN   2

Definition at line 125 of file dm.c.

#define DMF_MERGE_IS_OPTIONAL   6

Definition at line 129 of file dm.c.

#define DMF_NOFLUSH_SUSPENDING   5

Definition at line 128 of file dm.c.

#define DMF_SUSPENDED   1

Definition at line 124 of file dm.c.

#define MIN_IOS   256

Definition at line 216 of file dm.c.

#define MINOR_ALLOCED   ((void *)-1)

Definition at line 118 of file dm.c.

Function Documentation

struct dm_md_mempools* dm_alloc_md_mempools ( unsigned  type,
unsigned  integrity 
)
read

Definition at line 2714 of file dm.c.

int dm_create ( int  minor,
struct mapped_device **  result 
)

Definition at line 2127 of file dm.c.

int dm_deleting_md ( struct mapped_device md)

Definition at line 340 of file dm.c.

void dm_destroy ( struct mapped_device md)

Definition at line 2304 of file dm.c.

void dm_destroy_immediate ( struct mapped_device md)

Definition at line 2309 of file dm.c.

const char* dm_device_name ( struct mapped_device md)

Definition at line 2262 of file dm.c.

struct gendisk* dm_disk ( struct mapped_device md)
read

Definition at line 2667 of file dm.c.

void dm_dispatch_request ( struct request rq)

Definition at line 1446 of file dm.c.

void dm_free_md_mempools ( struct dm_md_mempools pools)

Definition at line 2764 of file dm.c.

void dm_get ( struct mapped_device md)

Definition at line 2256 of file dm.c.

uint32_t dm_get_event_nr ( struct mapped_device md)

Definition at line 2643 of file dm.c.

struct mapped_device* dm_get_from_kobject ( struct kobject kobj)
read

Definition at line 2681 of file dm.c.

int dm_get_geometry ( struct mapped_device md,
struct hd_geometry geo 
)

Definition at line 554 of file dm.c.

struct target_type* dm_get_immutable_target_type ( struct mapped_device md)
read

Definition at line 2165 of file dm.c.

struct dm_table* dm_get_live_table ( struct mapped_device md)
read

Definition at line 537 of file dm.c.

union map_info* dm_get_mapinfo ( struct bio *  bio)
write

Definition at line 103 of file dm.c.

struct mapped_device* dm_get_md ( dev_t  dev)
read

Definition at line 2235 of file dm.c.

unsigned dm_get_md_type ( struct mapped_device md)

Definition at line 2160 of file dm.c.

void* dm_get_mdptr ( struct mapped_device md)

Definition at line 2246 of file dm.c.

union map_info* dm_get_rq_mapinfo ( struct request rq)
write

Definition at line 110 of file dm.c.

void dm_kill_unmapped_request ( struct request clone,
int  error 
)

Definition at line 919 of file dm.c.

struct kobject* dm_kobject ( struct mapped_device md)
read

Definition at line 2672 of file dm.c.

int dm_kobject_uevent ( struct mapped_device md,
enum kobject_action  action,
unsigned  cookie 
)

Definition at line 2622 of file dm.c.

int dm_lock_for_deletion ( struct mapped_device md)

Definition at line 392 of file dm.c.

void dm_lock_md_type ( struct mapped_device md)

Definition at line 2145 of file dm.c.

uint32_t dm_next_uevent_seq ( struct mapped_device md)

Definition at line 2638 of file dm.c.

int dm_noflush_suspending ( struct dm_target ti)

Definition at line 2708 of file dm.c.

int dm_open_count ( struct mapped_device md)

Definition at line 384 of file dm.c.

void dm_put ( struct mapped_device md)

Definition at line 2314 of file dm.c.

int dm_queue_merge_is_compulsory ( struct request_queue q)

Definition at line 2006 of file dm.c.

void dm_requeue_unmapped_request ( struct request clone)

Definition at line 808 of file dm.c.

int dm_resume ( struct mapped_device md)

Definition at line 2580 of file dm.c.

int dm_set_geometry ( struct mapped_device md,
struct hd_geometry geo 
)

Definition at line 564 of file dm.c.

void dm_set_md_type ( struct mapped_device md,
unsigned  type 
)

Definition at line 2155 of file dm.c.

void dm_set_mdptr ( struct mapped_device md,
void ptr 
)

Definition at line 2251 of file dm.c.

int dm_set_target_max_io_len ( struct dm_target ti,
sector_t  len 
)

Definition at line 987 of file dm.c.

int dm_setup_md_queue ( struct mapped_device md)

Definition at line 2199 of file dm.c.

int dm_suspend ( struct mapped_device md,
unsigned  suspend_flags 
)

Definition at line 2476 of file dm.c.

int dm_suspended ( struct dm_target ti)

Definition at line 2702 of file dm.c.

int dm_suspended_md ( struct mapped_device md)

Definition at line 2697 of file dm.c.

struct dm_table* dm_swap_table ( struct mapped_device md,
struct dm_table table 
)
read

Definition at line 2390 of file dm.c.

void dm_uevent_add ( struct mapped_device md,
struct list_head elist 
)

Definition at line 2654 of file dm.c.

int dm_underlying_device_busy ( struct request_queue q)

Definition at line 1671 of file dm.c.

void dm_unlock_md_type ( struct mapped_device md)

Definition at line 2150 of file dm.c.

int dm_wait_event ( struct mapped_device md,
int  event_nr 
)

Definition at line 2648 of file dm.c.

EXPORT_SYMBOL ( dm_get_mapinfo  )
EXPORT_SYMBOL_GPL ( dm_get_rq_mapinfo  )
EXPORT_SYMBOL_GPL ( dm_requeue_unmapped_request  )
EXPORT_SYMBOL_GPL ( dm_kill_unmapped_request  )
EXPORT_SYMBOL_GPL ( dm_set_target_max_io_len  )
EXPORT_SYMBOL_GPL ( dm_dispatch_request  )
EXPORT_SYMBOL_GPL ( dm_underlying_device_busy  )
EXPORT_SYMBOL_GPL ( dm_get_md  )
EXPORT_SYMBOL_GPL ( dm_device_name  )
EXPORT_SYMBOL_GPL ( dm_put  )
EXPORT_SYMBOL_GPL ( dm_suspended  )
EXPORT_SYMBOL_GPL ( dm_noflush_suspending  )
MODULE_AUTHOR ( "Joe Thornber <[email protected]>"  )
MODULE_DESCRIPTION ( DM_NAME" driver"  )
module_exit ( dm_exit  )
module_init ( dm_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( major  ,
uint  ,
 
)
MODULE_PARM_DESC ( major  ,
"The major number of the device mapper"   
)