Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dm-region-hash.c File Reference
#include <linux/dm-dirty-log.h>
#include <linux/dm-region-hash.h>
#include <linux/ctype.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include "dm.h"

Go to the source code of this file.

Data Structures

struct  dm_region_hash
 
struct  dm_region
 

Macros

#define DM_MSG_PREFIX   "region hash"
 
#define RH_HASH_MULT   2654435387U
 
#define RH_HASH_SHIFT   12
 
#define MIN_REGIONS   64
 

Functions

sector_t dm_rh_region_to_sector (struct dm_region_hash *rh, region_t region)
 
 EXPORT_SYMBOL_GPL (dm_rh_region_to_sector)
 
region_t dm_rh_bio_to_region (struct dm_region_hash *rh, struct bio *bio)
 
 EXPORT_SYMBOL_GPL (dm_rh_bio_to_region)
 
voiddm_rh_region_context (struct dm_region *reg)
 
 EXPORT_SYMBOL_GPL (dm_rh_region_context)
 
region_t dm_rh_get_region_key (struct dm_region *reg)
 
 EXPORT_SYMBOL_GPL (dm_rh_get_region_key)
 
sector_t dm_rh_get_region_size (struct dm_region_hash *rh)
 
 EXPORT_SYMBOL_GPL (dm_rh_get_region_size)
 
struct dm_region_hashdm_region_hash_create (void *context, void(*dispatch_bios)(void *context, struct bio_list *bios), void(*wakeup_workers)(void *context), void(*wakeup_all_recovery_waiters)(void *context), sector_t target_begin, unsigned max_recovery, struct dm_dirty_log *log, uint32_t region_size, region_t nr_regions)
 
 EXPORT_SYMBOL_GPL (dm_region_hash_create)
 
void dm_region_hash_destroy (struct dm_region_hash *rh)
 
 EXPORT_SYMBOL_GPL (dm_region_hash_destroy)
 
struct dm_dirty_log * dm_rh_dirty_log (struct dm_region_hash *rh)
 
 EXPORT_SYMBOL_GPL (dm_rh_dirty_log)
 
int dm_rh_get_state (struct dm_region_hash *rh, region_t region, int may_block)
 
 EXPORT_SYMBOL_GPL (dm_rh_get_state)
 
void dm_rh_mark_nosync (struct dm_region_hash *rh, struct bio *bio)
 
 EXPORT_SYMBOL_GPL (dm_rh_mark_nosync)
 
void dm_rh_update_states (struct dm_region_hash *rh, int errors_handled)
 
 EXPORT_SYMBOL_GPL (dm_rh_update_states)
 
void dm_rh_inc_pending (struct dm_region_hash *rh, struct bio_list *bios)
 
 EXPORT_SYMBOL_GPL (dm_rh_inc_pending)
 
void dm_rh_dec (struct dm_region_hash *rh, region_t region)
 
 EXPORT_SYMBOL_GPL (dm_rh_dec)
 
void dm_rh_recovery_prepare (struct dm_region_hash *rh)
 
 EXPORT_SYMBOL_GPL (dm_rh_recovery_prepare)
 
struct dm_regiondm_rh_recovery_start (struct dm_region_hash *rh)
 
 EXPORT_SYMBOL_GPL (dm_rh_recovery_start)
 
void dm_rh_recovery_end (struct dm_region *reg, int success)
 
 EXPORT_SYMBOL_GPL (dm_rh_recovery_end)
 
int dm_rh_recovery_in_flight (struct dm_region_hash *rh)
 
 EXPORT_SYMBOL_GPL (dm_rh_recovery_in_flight)
 
int dm_rh_flush (struct dm_region_hash *rh)
 
 EXPORT_SYMBOL_GPL (dm_rh_flush)
 
void dm_rh_delay (struct dm_region_hash *rh, struct bio *bio)
 
 EXPORT_SYMBOL_GPL (dm_rh_delay)
 
void dm_rh_stop_recovery (struct dm_region_hash *rh)
 
 EXPORT_SYMBOL_GPL (dm_rh_stop_recovery)
 
void dm_rh_start_recovery (struct dm_region_hash *rh)
 
 EXPORT_SYMBOL_GPL (dm_rh_start_recovery)
 
 MODULE_DESCRIPTION (DM_NAME" region hash")
 
 MODULE_AUTHOR ("Joe Thornber/Heinz Mauelshagen <[email protected]>")
 
 MODULE_LICENSE ("GPL")
 

Macro Definition Documentation

#define DM_MSG_PREFIX   "region hash"

Definition at line 19 of file dm-region-hash.c.

#define MIN_REGIONS   64

Definition at line 158 of file dm-region-hash.c.

#define RH_HASH_MULT   2654435387U

Definition at line 155 of file dm-region-hash.c.

#define RH_HASH_SHIFT   12

Definition at line 156 of file dm-region-hash.c.

Function Documentation

struct dm_region_hash* dm_region_hash_create ( void context,
void(*)(void *context, struct bio_list *bios dispatch_bios,
void(*)(void *context wakeup_workers,
void(*)(void *context wakeup_all_recovery_waiters,
sector_t  target_begin,
unsigned  max_recovery,
struct dm_dirty_log *  log,
uint32_t  region_size,
region_t  nr_regions 
)
read

Definition at line 159 of file dm-region-hash.c.

void dm_region_hash_destroy ( struct dm_region_hash rh)

Definition at line 234 of file dm-region-hash.c.

region_t dm_rh_bio_to_region ( struct dm_region_hash rh,
struct bio *  bio 
)

Definition at line 127 of file dm-region-hash.c.

void dm_rh_dec ( struct dm_region_hash rh,
region_t  region 
)

Definition at line 537 of file dm-region-hash.c.

void dm_rh_delay ( struct dm_region_hash rh,
struct bio *  bio 
)

Definition at line 689 of file dm-region-hash.c.

struct dm_dirty_log* dm_rh_dirty_log ( struct dm_region_hash rh)
read

Definition at line 259 of file dm-region-hash.c.

int dm_rh_flush ( struct dm_region_hash rh)

Definition at line 683 of file dm-region-hash.c.

region_t dm_rh_get_region_key ( struct dm_region reg)

Definition at line 139 of file dm-region-hash.c.

sector_t dm_rh_get_region_size ( struct dm_region_hash rh)

Definition at line 145 of file dm-region-hash.c.

int dm_rh_get_state ( struct dm_region_hash rh,
region_t  region,
int  may_block 
)

Definition at line 337 of file dm-region-hash.c.

void dm_rh_inc_pending ( struct dm_region_hash rh,
struct bio_list bios 
)

Definition at line 525 of file dm-region-hash.c.

void dm_rh_mark_nosync ( struct dm_region_hash rh,
struct bio *  bio 
)

Definition at line 394 of file dm-region-hash.c.

void dm_rh_recovery_end ( struct dm_region reg,
int  success 
)

Definition at line 660 of file dm-region-hash.c.

int dm_rh_recovery_in_flight ( struct dm_region_hash rh)

Definition at line 677 of file dm-region-hash.c.

void dm_rh_recovery_prepare ( struct dm_region_hash rh)

Definition at line 621 of file dm-region-hash.c.

struct dm_region* dm_rh_recovery_start ( struct dm_region_hash rh)
read

Definition at line 644 of file dm-region-hash.c.

void* dm_rh_region_context ( struct dm_region reg)

Definition at line 133 of file dm-region-hash.c.

sector_t dm_rh_region_to_sector ( struct dm_region_hash rh,
region_t  region 
)

Definition at line 121 of file dm-region-hash.c.

void dm_rh_start_recovery ( struct dm_region_hash rh)

Definition at line 710 of file dm-region-hash.c.

void dm_rh_stop_recovery ( struct dm_region_hash rh)

Definition at line 700 of file dm-region-hash.c.

void dm_rh_update_states ( struct dm_region_hash rh,
int  errors_handled 
)

Definition at line 439 of file dm-region-hash.c.

EXPORT_SYMBOL_GPL ( dm_rh_region_to_sector  )
EXPORT_SYMBOL_GPL ( dm_rh_bio_to_region  )
EXPORT_SYMBOL_GPL ( dm_rh_region_context  )
EXPORT_SYMBOL_GPL ( dm_rh_get_region_key  )
EXPORT_SYMBOL_GPL ( dm_rh_get_region_size  )
EXPORT_SYMBOL_GPL ( dm_region_hash_create  )
EXPORT_SYMBOL_GPL ( dm_region_hash_destroy  )
EXPORT_SYMBOL_GPL ( dm_rh_dirty_log  )
EXPORT_SYMBOL_GPL ( dm_rh_get_state  )
EXPORT_SYMBOL_GPL ( dm_rh_mark_nosync  )
EXPORT_SYMBOL_GPL ( dm_rh_update_states  )
EXPORT_SYMBOL_GPL ( dm_rh_inc_pending  )
EXPORT_SYMBOL_GPL ( dm_rh_dec  )
EXPORT_SYMBOL_GPL ( dm_rh_recovery_prepare  )
EXPORT_SYMBOL_GPL ( dm_rh_recovery_start  )
EXPORT_SYMBOL_GPL ( dm_rh_recovery_end  )
EXPORT_SYMBOL_GPL ( dm_rh_recovery_in_flight  )
EXPORT_SYMBOL_GPL ( dm_rh_flush  )
EXPORT_SYMBOL_GPL ( dm_rh_delay  )
EXPORT_SYMBOL_GPL ( dm_rh_stop_recovery  )
EXPORT_SYMBOL_GPL ( dm_rh_start_recovery  )
MODULE_AUTHOR ( "Joe Thornber/Heinz Mauelshagen <[email protected]>"  )
MODULE_DESCRIPTION ( DM_NAME" region hash )
MODULE_LICENSE ( "GPL"  )