master - cachevol: drop no longer needed functions
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1cd308d6406d297591c9a9f3ee043efe9150203b Commit: 1cd308d6406d297591c9a9f3ee043efe9150203b Parent: 201ffbd04a76789eb5b1ef3aced6a89cb064d4c6 Author: Zdenek Kabelac <[email protected]> AuthorDate: Mon Oct 14 10:23:51 2019 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Oct 14 15:20:25 2019 +0200
cachevol: drop no longer needed functions
Code is no longer used/needed.
--- lib/activate/dev_manager.c | 85 ------------------ lib/activate/dev_manager.h | 8 -- lib/metadata/cache_manip.c | 180 -------------------------------------- lib/metadata/metadata-exported.h | 1 - 4 files changed, 0 insertions(+), 274 deletions(-)
lib/activate/dev_manager.c +0 -85
@@ -837,91 +837,6 @@ static int _info(struct cmd_context *cmd,return 1 ; } -/* FIXME: could we just use dev_manager_info instead of this? */ - -int get_cache_vol_meta_data (struct cmd_context *cmd, -struct logical_volume *lv, -struct logical_volume *pool_lv, -struct dm_info *info_meta,struct dm_info *info_data) -{ -struct lv_segment *lvseg =first_seg (lv); -union lvid lvid_meta; -union lvid lvid_data; -char *name_meta; -char *name_data; -char *dlid_meta; -char *dlid_data; - -memset (&lvid_meta,0 ,sizeof (lvid_meta)); -memset (&lvid_data,0 ,sizeof (lvid_meta)); -memcpy (&lvid_meta.id[0 ], &lv->vg->id,sizeof (struct id )); -memcpy (&lvid_meta.id[1 ], &lvseg->metadata_id,sizeof (struct id )); -memcpy (&lvid_data.id[0 ], &lv->vg->id,sizeof (struct id )); -memcpy (&lvid_data.id[1 ], &lvseg->data_id,sizeof (struct id )); - -if (!(dlid_meta =dm_build_dm_uuid (cmd->mem,UUID_PREFIX , (const char *)&lvid_meta.s,"cmeta" ))) - return_0; -if (!(dlid_data =dm_build_dm_uuid (cmd->mem,UUID_PREFIX , (const char *)&lvid_data.s,"cdata" ))) - return_0; -if (!(name_meta =dm_build_dm_name (cmd->mem, lv->vg->name, pool_lv->name,"_cmeta" ))) - return_0; -if (!(name_data =dm_build_dm_name (cmd->mem, lv->vg->name, pool_lv->name,"_cdata" ))) - return_0; - -if (!_info (cmd, name_meta, dlid_meta,1 ,0 , info_meta,NULL ,NULL )) - return_0; - -if (!_info (cmd, name_data, dlid_data,1 ,0 , info_data,NULL ,NULL )) - return_0; - -return 1 ; -} - -/* -* FIXME: isn't there a simpler, more direct way to just remove these two dm -* devs? -*/ - -int remove_cache_vol_meta_data (struct cmd_context *cmd, -struct dm_info *info_meta,struct dm_info *info_data) -{ -struct dm_tree *dtree; -struct dm_tree_node *root; -struct dm_tree_node *child; -const char *uuid; -void *handle =NULL ; - -if (!(dtree =dm_tree_create ())) - goto_out; - -if (!dm_tree_add_dev (dtree, info_meta->major, info_meta->minor)) - goto_out; - -if (!dm_tree_add_dev (dtree, info_data->major, info_data->minor)) - goto_out; - -if (!(root =dm_tree_find_node (dtree,0 ,0 ))) - goto_out; - -while ((child =dm_tree_next_child (&handle, root,0 ))) { -if (!(uuid =dm_tree_node_get_uuid (child))) { - stack; -continue ; - } - -if (!dm_tree_deactivate_children (root, uuid,strlen (uuid))) { - stack; -continue ; - } - } - -dm_tree_free (dtree); -return 1 ; - out: -dm_tree_free (dtree); -return 0 ; -} -int dev_manager_remove_dm_major_minor (uint32_t major,uint32_t minor) {struct dm_task *dmt;
lib/activate/dev_manager.h +0 -8
@@ -109,12 +109,4 @@ int dev_manager_remove_dm_major_minor(uint32_t major, uint32_t minor);int dev_manager_check_prefix_dm_major_minor (uint32_t major,uint32_t minor,const char *prefix); -int get_cache_vol_meta_data (struct cmd_context *cmd, -struct logical_volume *lv, -struct logical_volume *pool_lv, -struct dm_info *info_meta,struct dm_info *info_data); - -int remove_cache_vol_meta_data (struct cmd_context *cmd, -struct dm_info *info_meta,struct dm_info *info_data); -#endif
lib/metadata/cache_manip.c +0 -180
186 lines not on this page · raw message
lib/metadata/metadata-exported.h +0 -1
@@ -1279,7 +1279,6 @@ struct logical_volume *lv_cache_create(struct logical_volume *pool_lv, struct logical_volume *origin_lv);int lv_cache_wait_for_clean (struct logical_volume *cache_lv,int *is_clean);int lv_cache_remove (struct logical_volume *cache_lv); -int lv_detach_cache_vol (struct logical_volume *cache_lv,int noflush);int lv_detach_writecache_cachevol (struct logical_volume *cache_lv,int noflush);int wipe_cache_pool (struct logical_volume *cache_pool_lv);/* -- metadata/cache_manip.c */