1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

New activation code. [Not ready to be used yet.]

This commit is contained in:
Alasdair Kergon 2005-11-08 22:50:11 +00:00
parent 2b367220f3
commit 165e4a112b
4 changed files with 1134 additions and 46 deletions

View File

@ -1,10 +1,13 @@
dm_lib_release
dm_lib_exit
dm_driver_version
dm_get_library_version
dm_log_init
dm_log_init_verbose
dm_task_create
dm_task_destroy
dm_task_set_name
dm_task_set_uuid
dm_get_library_version
dm_task_get_driver_version
dm_task_get_info
dm_task_get_deps
@ -22,24 +25,39 @@ dm_task_set_message
dm_task_add_target
dm_task_no_open_count
dm_task_skip_lockfs
dm_get_next_target
dm_task_run
dm_get_next_target
dm_set_dev_dir
dm_dir
dm_format_dev
dm_lib_release
dm_lib_exit
dm_deptree_create
dm_deptree_free
dm_deptree_add_dev
dm_deptree_add_new_dev
dm_deptree_node_get_name
dm_deptree_node_get_uuid
dm_deptree_node_get_info
dm_deptree_node_get_context
dm_deptree_node_num_children
dm_deptree_node_num_parents
dm_deptree_find_node
dm_deptree_find_node_by_uuid
dm_deptree_next_child
dm_deptree_next_parent
dm_deptree_deactivate_children
dm_deptree_activate_children
dm_deptree_preload_children
dm_deptree_suspend_children
dm_deptree_children_use_uuid
dm_deptree_node_add_snapshot_origin_target
dm_deptree_node_add_snapshot_target
dm_deptree_node_add_error_target
dm_deptree_node_add_zero_target
dm_deptree_node_add_linear_target
dm_deptree_node_add_striped_target
dm_deptree_node_add_mirror_target
dm_deptree_node_add_mirror_target_log
dm_deptree_node_add_target_area
dm_is_dm_major
dm_mknodes
dm_malloc_aux
@ -81,8 +99,4 @@ dm_hash_get_key
dm_hash_get_data
dm_hash_get_first
dm_hash_get_next
dm_driver_version
dm_deptree_deactivate_children
dm_deptree_suspend_children
dm_deptree_children_use_uuid
dm_set_selinux_context

View File

@ -642,7 +642,7 @@ static int _dm_task_run_v1(struct dm_task *dmt)
dmi = _flatten_v1(dmt);
if (!dmi) {
log_error("Couldn't create ioctl argument");
log_error("Couldn't create ioctl argument.");
return 0;
}
@ -1167,8 +1167,8 @@ static struct dm_ioctl *_flatten(struct dm_task *dmt, unsigned repeat_count)
if (dmt->minor >= 0) {
if (dmt->major <= 0) {
log_error("Missing major number for persistent device");
return NULL;
log_error("Missing major number for persistent device.");
goto bad;
}
dmi->flags |= DM_PERSISTENT_DEV_FLAG;
dmi->dev = MKDEV(dmt->major, dmt->minor);
@ -1349,7 +1349,7 @@ static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command,
dmi = _flatten(dmt, repeat_count);
if (!dmi) {
log_error("Couldn't create ioctl argument");
log_error("Couldn't create ioctl argument.");
return NULL;
}
@ -1361,7 +1361,7 @@ static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command,
if (dmt->no_open_count)
dmi->flags |= DM_SKIP_BDGET_FLAG;
log_debug("dm %s %s %s%s%s %s%0.0d%s%0.0d"
log_debug("dm %s %s %s%s%s %s%0.0d%s%0.0d%s"
"%s%c %.0llu %s [%u]",
_cmd_data_v4[dmt->type].name,
dmi->name, dmi->uuid, dmt->newname ? " " : "",
@ -1370,6 +1370,7 @@ static struct dm_ioctl *_do_dm_ioctl(struct dm_task *dmt, unsigned command,
dmt->major > 0 ? dmt->major : 0,
dmt->major > 0 ? ":" : "",
dmt->minor > 0 ? dmt->minor : 0,
dmt->major > 0 && dmt->minor == 0 ? "0" : "",
dmt->major > 0 ? ") " : "",
dmt->no_open_count ? 'N' : 'O',
dmt->sector, dmt->message ? dmt->message : "",

View File

@ -215,13 +215,26 @@ void dm_deptree_free(struct deptree *deptree);
*/
int dm_deptree_add_dev(struct deptree *deptree, uint32_t major, uint32_t minor);
/*
* Add a new node to the tree if it doesn't already exist.
*/
struct deptree_node *dm_deptree_add_new_dev(struct deptree *deptree,
const char *name,
const char *uuid,
uint32_t major, uint32_t minor,
int read_only,
int clear_inactive,
void *context);
/*
* Search for a node in the tree.
* Set major and minor to 0 to get the root node.
* Set major and minor to 0 or uuid to NULL to get the root node.
*/
struct deptree_node *dm_deptree_find_node(struct deptree *deptree,
uint32_t major,
uint32_t minor);
struct deptree_node *dm_deptree_find_node_by_uuid(struct deptree *deptree,
const char *uuid);
/*
* Use this to walk through all children of a given node.
@ -239,6 +252,7 @@ struct deptree_node *dm_deptree_next_child(void **handle,
const char *dm_deptree_node_get_name(struct deptree_node *node);
const char *dm_deptree_node_get_uuid(struct deptree_node *node);
const struct dm_info *dm_deptree_node_get_info(struct deptree_node *node);
void *dm_deptree_node_get_context(struct deptree_node *node);
/*
* Returns the number of children of the given node (excluding the root node).
@ -253,6 +267,21 @@ int dm_deptree_node_num_children(struct deptree_node *node, uint32_t inverted);
int dm_deptree_deactivate_children(struct deptree_node *dnode,
const char *uuid_prefix,
size_t uuid_prefix_len);
/*
* Preload/create a device plus all dependencies.
* Ignores devices that don't have a uuid starting with uuid_prefix.
*/
int dm_deptree_preload_children(struct deptree_node *dnode,
const char *uuid_prefix,
size_t uuid_prefix_len);
/*
* Resume a device plus all dependencies.
* Ignores devices that don't have a uuid starting with uuid_prefix.
*/
int dm_deptree_activate_children(struct deptree_node *dnode,
const char *uuid_prefix,
size_t uuid_prefix_len);
/*
* Suspend a device plus all dependencies.
@ -271,6 +300,39 @@ int dm_deptree_children_use_uuid(struct deptree_node *dnode,
const char *uuid_prefix,
size_t uuid_prefix_len);
/*
* Construct tables for new nodes.
*/
int dm_deptree_node_add_snapshot_origin_target(struct deptree_node *dnode,
uint64_t size,
const char *origin_uuid);
int dm_deptree_node_add_snapshot_target(struct deptree_node *node,
uint64_t size,
const char *origin_uuid,
const char *cow_uuid,
int persistent,
uint32_t chunk_size);
int dm_deptree_node_add_error_target(struct deptree_node *node,
uint64_t size);
int dm_deptree_node_add_zero_target(struct deptree_node *node,
uint64_t size);
int dm_deptree_node_add_linear_target(struct deptree_node *node,
uint64_t size);
int dm_deptree_node_add_striped_target(struct deptree_node *node,
uint64_t size,
uint32_t stripe_size);
int dm_deptree_node_add_mirror_target(struct deptree_node *node,
uint64_t size);
int dm_deptree_node_add_mirror_target_log(struct deptree_node *node,
uint32_t region_size,
unsigned clustered,
const char *log_uuid,
unsigned area_count);
int dm_deptree_node_add_target_area(struct deptree_node *node,
const char *dev_name,
const char *dlid,
uint64_t offset);
/*****************************************************************************
* Library functions
*****************************************************************************/

File diff suppressed because it is too large Load Diff