Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
dm-thin-metadata.c File Reference
#include "dm-thin-metadata.h"
#include "persistent-data/dm-btree.h"
#include "persistent-data/dm-space-map.h"
#include "persistent-data/dm-space-map-disk.h"
#include "persistent-data/dm-transaction-manager.h"
#include <linux/list.h>
#include <linux/device-mapper.h>
#include <linux/workqueue.h>

Go to the source code of this file.

Data Structures

struct  thin_disk_superblock
 
struct  disk_device_details
 
struct  dm_pool_metadata
 
struct  dm_thin_device
 

Macros

#define DM_MSG_PREFIX   "thin metadata"
 
#define THIN_SUPERBLOCK_MAGIC   27022010
 
#define THIN_SUPERBLOCK_LOCATION   0
 
#define THIN_VERSION   1
 
#define THIN_METADATA_CACHE_SIZE   64
 
#define SECTOR_TO_BLOCK_SHIFT   3
 
#define THIN_MAX_CONCURRENT_LOCKS   5
 
#define SPACE_MAP_ROOT_SIZE   128
 
#define SUPERBLOCK_CSUM_XOR   160774
 

Functions

struct dm_pool_metadatadm_pool_metadata_open (struct block_device *bdev, sector_t data_block_size, bool format_device)
 
int dm_pool_metadata_close (struct dm_pool_metadata *pmd)
 
int dm_pool_create_thin (struct dm_pool_metadata *pmd, dm_thin_id dev)
 
int dm_pool_create_snap (struct dm_pool_metadata *pmd, dm_thin_id dev, dm_thin_id origin)
 
int dm_pool_delete_thin_device (struct dm_pool_metadata *pmd, dm_thin_id dev)
 
int dm_pool_set_metadata_transaction_id (struct dm_pool_metadata *pmd, uint64_t current_id, uint64_t new_id)
 
int dm_pool_get_metadata_transaction_id (struct dm_pool_metadata *pmd, uint64_t *result)
 
int dm_pool_reserve_metadata_snap (struct dm_pool_metadata *pmd)
 
int dm_pool_release_metadata_snap (struct dm_pool_metadata *pmd)
 
int dm_pool_get_metadata_snap (struct dm_pool_metadata *pmd, dm_block_t *result)
 
int dm_pool_open_thin_device (struct dm_pool_metadata *pmd, dm_thin_id dev, struct dm_thin_device **td)
 
int dm_pool_close_thin_device (struct dm_thin_device *td)
 
dm_thin_id dm_thin_dev_id (struct dm_thin_device *td)
 
int dm_thin_find_block (struct dm_thin_device *td, dm_block_t block, int can_block, struct dm_thin_lookup_result *result)
 
int dm_thin_insert_block (struct dm_thin_device *td, dm_block_t block, dm_block_t data_block)
 
int dm_thin_remove_block (struct dm_thin_device *td, dm_block_t block)
 
bool dm_thin_changed_this_transaction (struct dm_thin_device *td)
 
bool dm_thin_aborted_changes (struct dm_thin_device *td)
 
int dm_pool_alloc_data_block (struct dm_pool_metadata *pmd, dm_block_t *result)
 
int dm_pool_commit_metadata (struct dm_pool_metadata *pmd)
 
int dm_pool_abort_metadata (struct dm_pool_metadata *pmd)
 
int dm_pool_get_free_block_count (struct dm_pool_metadata *pmd, dm_block_t *result)
 
int dm_pool_get_free_metadata_block_count (struct dm_pool_metadata *pmd, dm_block_t *result)
 
int dm_pool_get_metadata_dev_size (struct dm_pool_metadata *pmd, dm_block_t *result)
 
int dm_pool_get_data_block_size (struct dm_pool_metadata *pmd, sector_t *result)
 
int dm_pool_get_data_dev_size (struct dm_pool_metadata *pmd, dm_block_t *result)
 
int dm_thin_get_mapped_count (struct dm_thin_device *td, dm_block_t *result)
 
int dm_thin_get_highest_mapped_block (struct dm_thin_device *td, dm_block_t *result)
 
int dm_pool_resize_data_dev (struct dm_pool_metadata *pmd, dm_block_t new_count)
 
void dm_pool_metadata_read_only (struct dm_pool_metadata *pmd)
 

Variables

struct thin_disk_superblock __packed
 

Macro Definition Documentation

#define DM_MSG_PREFIX   "thin metadata"

Definition at line 75 of file dm-thin-metadata.c.

#define SECTOR_TO_BLOCK_SHIFT   3

Definition at line 81 of file dm-thin-metadata.c.

#define SPACE_MAP_ROOT_SIZE   128

Definition at line 90 of file dm-thin-metadata.c.

#define SUPERBLOCK_CSUM_XOR   160774

Definition at line 215 of file dm-thin-metadata.c.

#define THIN_MAX_CONCURRENT_LOCKS   5

Definition at line 87 of file dm-thin-metadata.c.

#define THIN_METADATA_CACHE_SIZE   64

Definition at line 80 of file dm-thin-metadata.c.

#define THIN_SUPERBLOCK_LOCATION   0

Definition at line 78 of file dm-thin-metadata.c.

#define THIN_SUPERBLOCK_MAGIC   27022010

Definition at line 77 of file dm-thin-metadata.c.

#define THIN_VERSION   1

Definition at line 79 of file dm-thin-metadata.c.

Function Documentation

int dm_pool_abort_metadata ( struct dm_pool_metadata pmd)

Definition at line 1524 of file dm-thin-metadata.c.

int dm_pool_alloc_data_block ( struct dm_pool_metadata pmd,
dm_block_t result 
)

Definition at line 1483 of file dm-thin-metadata.c.

int dm_pool_close_thin_device ( struct dm_thin_device td)

Definition at line 1338 of file dm-thin-metadata.c.

int dm_pool_commit_metadata ( struct dm_pool_metadata pmd)

Definition at line 1495 of file dm-thin-metadata.c.

int dm_pool_create_snap ( struct dm_pool_metadata pmd,
dm_thin_id  dev,
dm_thin_id  origin 
)

Definition at line 1080 of file dm-thin-metadata.c.

int dm_pool_create_thin ( struct dm_pool_metadata pmd,
dm_thin_id  dev 
)

Definition at line 991 of file dm-thin-metadata.c.

int dm_pool_delete_thin_device ( struct dm_pool_metadata pmd,
dm_thin_id  dev 
)

Definition at line 1124 of file dm-thin-metadata.c.

int dm_pool_get_data_block_size ( struct dm_pool_metadata pmd,
sector_t result 
)

Definition at line 1582 of file dm-thin-metadata.c.

int dm_pool_get_data_dev_size ( struct dm_pool_metadata pmd,
dm_block_t result 
)

Definition at line 1591 of file dm-thin-metadata.c.

int dm_pool_get_free_block_count ( struct dm_pool_metadata pmd,
dm_block_t result 
)

Definition at line 1544 of file dm-thin-metadata.c.

int dm_pool_get_free_metadata_block_count ( struct dm_pool_metadata pmd,
dm_block_t result 
)

Definition at line 1556 of file dm-thin-metadata.c.

int dm_pool_get_metadata_dev_size ( struct dm_pool_metadata pmd,
dm_block_t result 
)

Definition at line 1569 of file dm-thin-metadata.c.

int dm_pool_get_metadata_snap ( struct dm_pool_metadata pmd,
dm_block_t result 
)

Definition at line 1312 of file dm-thin-metadata.c.

int dm_pool_get_metadata_transaction_id ( struct dm_pool_metadata pmd,
uint64_t result 
)

Definition at line 1162 of file dm-thin-metadata.c.

int dm_pool_metadata_close ( struct dm_pool_metadata pmd)

Definition at line 837 of file dm-thin-metadata.c.

struct dm_pool_metadata* dm_pool_metadata_open ( struct block_device bdev,
sector_t  data_block_size,
bool  format_device 
)
read

Definition at line 800 of file dm-thin-metadata.c.

void dm_pool_metadata_read_only ( struct dm_pool_metadata pmd)

Definition at line 1680 of file dm-thin-metadata.c.

int dm_pool_open_thin_device ( struct dm_pool_metadata pmd,
dm_thin_id  dev,
struct dm_thin_device **  td 
)

Definition at line 1325 of file dm-thin-metadata.c.

int dm_pool_release_metadata_snap ( struct dm_pool_metadata pmd)

Definition at line 1282 of file dm-thin-metadata.c.

int dm_pool_reserve_metadata_snap ( struct dm_pool_metadata pmd)

Definition at line 1236 of file dm-thin-metadata.c.

int dm_pool_resize_data_dev ( struct dm_pool_metadata pmd,
dm_block_t  new_count 
)

Definition at line 1668 of file dm-thin-metadata.c.

int dm_pool_set_metadata_transaction_id ( struct dm_pool_metadata pmd,
uint64_t  current_id,
uint64_t  new_id 
)

Definition at line 1137 of file dm-thin-metadata.c.

bool dm_thin_aborted_changes ( struct dm_thin_device td)

Definition at line 1472 of file dm-thin-metadata.c.

bool dm_thin_changed_this_transaction ( struct dm_thin_device td)

Definition at line 1461 of file dm-thin-metadata.c.

dm_thin_id dm_thin_dev_id ( struct dm_thin_device td)

Definition at line 1347 of file dm-thin-metadata.c.

int dm_thin_find_block ( struct dm_thin_device td,
dm_block_t  block,
int  can_block,
struct dm_thin_lookup_result result 
)

Definition at line 1357 of file dm-thin-metadata.c.

int dm_thin_get_highest_mapped_block ( struct dm_thin_device td,
dm_block_t result 
)

Definition at line 1634 of file dm-thin-metadata.c.

int dm_thin_get_mapped_count ( struct dm_thin_device td,
dm_block_t result 
)

Definition at line 1603 of file dm-thin-metadata.c.

int dm_thin_insert_block ( struct dm_thin_device td,
dm_block_t  block,
dm_block_t  data_block 
)

Definition at line 1420 of file dm-thin-metadata.c.

int dm_thin_remove_block ( struct dm_thin_device td,
dm_block_t  block 
)

Definition at line 1449 of file dm-thin-metadata.c.

Variable Documentation