Udev integration: add cookie support for dm trees
PATCH 4/4 Udev integration: add cookie support for dm trees
This patch adds support for the LVM layer where DM trees are used. We set only one semaphore per tree. The functionality and logic is the same as in previous patch for dmsetup.
Peter
lib/activate/dev_manager.c +4 -4
@@ -1123,7 +1123,7 @@ static int _clean_tree(struct dev_manager *dm, struct dm_tree_node *root)if (!*layer)continue ; -if (!dm_tree_deactivate_children (root, uuid,strlen (uuid))) +if (!dm_tree_deactivate_children (root, uuid,strlen (uuid),0 )) return_0; }
@@ -1157,7 +1157,7 @@ static int _tree_action(struct dev_manager *dm, struct logical_volume *lv, actiobreak ;case DEACTIVATE :/* Deactivate LV and all devices it references that nothing else has open. */ -if (!dm_tree_deactivate_children (root, dlid,ID_LEN +sizeof (UUID_PREFIX ) -1 )) +if (!dm_tree_deactivate_children (root, dlid,ID_LEN +sizeof (UUID_PREFIX ) -1 ,0 )) goto_out;if (!_remove_lv_symlinks (dm, root))log_error ("Failed to remove all device symlinks associated with %s." , lv->name);
@@ -1177,11 +1177,11 @@ static int _tree_action(struct dev_manager *dm, struct logical_volume *lv, actio goto_out;/* Preload any devices required before any suspensions */ -if (!dm_tree_preload_children (root, dlid,ID_LEN +sizeof (UUID_PREFIX ) -1 )) +if (!dm_tree_preload_children (root, dlid,ID_LEN +sizeof (UUID_PREFIX ) -1 ,0 )) goto_out;if ((action ==ACTIVATE ) && - !dm_tree_activate_children (root, dlid,ID_LEN +sizeof (UUID_PREFIX ) -1 )) + !dm_tree_activate_children (root, dlid,ID_LEN +sizeof (UUID_PREFIX ) -1 ,0 )) goto_out;if (!_create_lv_symlinks (dm, root)) {
libdm/libdevmapper.h +6 -6
@@ -308,23 +308,23 @@ int dm_tree_node_num_children(struct dm_tree_node *node, uint32_t inverted);* Ignores devices that don't have a uuid starting with uuid_prefix. */ int dm_tree_deactivate_children (struct dm_tree_node *dnode, -const char *uuid_prefix, -size_t uuid_prefix_len); +const char *uuid_prefix,size_t uuid_prefix_len, +uint32_t cookie);/* * Preload/create a device plus all dependencies. * Ignores devices that don't have a uuid starting with uuid_prefix. */ int dm_tree_preload_children (struct dm_tree_node *dnode, -const char *uuid_prefix, -size_t uuid_prefix_len); +const char *uuid_prefix,size_t uuid_prefix_len, +uint32_t cookie);/* * Resume a device plus all dependencies. * Ignores devices that don't have a uuid starting with uuid_prefix. */ int dm_tree_activate_children (struct dm_tree_node *dnode, -const char *uuid_prefix, -size_t uuid_prefix_len); +const char *uuid_prefix,size_t uuid_prefix_len, +uint32_t cookie);/* * Suspend a device plus all dependencies.
libdm/libdm-deptree.c +103 -29
305 lines not on this page · raw message