master - lvm: change build_dm_uuid API
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6a0d97a65c793e5875fc6c4f0a815c37ed4b6d38 Commit: 6a0d97a65c793e5875fc6c4f0a815c37ed4b6d38 Parent: 4d64e91efde5335eeae6f2e0fcdf4992b054644a Author: Zdenek Kabelac <[email protected]> AuthorDate: Tue Mar 11 17:13:47 2014 +0100 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Wed Mar 12 00:16:20 2014 +0100
lvm: change build_dm_uuid API
Pass directly 'lv' into this build routine, so we can eventually add more private UUID suffixes.
--- WHATS_NEW | 1 + lib/activate/activate.c | 2 +- lib/activate/dev_manager.c | 62 ++++++++++++++++++++++---------------------- lib/cache_segtype/cache.c | 6 ++-- lib/mirror/mirrored.c | 4 +- lib/misc/lvm-string.c | 5 +++- lib/misc/lvm-string.h | 3 +- lib/thin/thin.c | 8 +++--- 8 files changed, 48 insertions(+), 43 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.106 - ==================================== + Update API for internal function build_dm_uuid(). Do not try to check empty pool with scheduled messages. Fix return value in pool_has_message() when quering for any message. Cleanup all client resources on clvmd exit.
lib/activate/activate.c +1 -1
@@ -1546,7 +1546,7 @@ static char *_build_target_uuid(struct cmd_context *cmd, struct logical_volume *else layer =NULL ; -return build_dm_uuid (cmd->mem, lv->lvid.s, layer); +return build_dm_uuid (cmd->mem, lv, layer); } int target_registered_with_dmeventd(struct cmd_context *cmd, const char *dso,
lib/activate/dev_manager.c +31 -31
233 lines not on this page · raw message
lib/cache_segtype/cache.c +3 -3
@@ -360,13 +360,13 @@ static int _cache_add_target_line(struct dev_manager *dm,struct lv_segment *cache_pool_seg =first_seg (seg->pool_lv);char *metadata_uuid, *data_uuid, *origin_uuid; -if (!(metadata_uuid =build_dm_uuid (mem, cache_pool_seg->metadata_lv->lvid.s,NULL ))) +if (!(metadata_uuid =build_dm_uuid (mem, cache_pool_seg->metadata_lv,NULL ))) return_0; -if (!(data_uuid =build_dm_uuid (mem,seg_lv (cache_pool_seg,0 )->lvid.s,NULL ))) +if (!(data_uuid =build_dm_uuid (mem,seg_lv (cache_pool_seg,0 ),NULL ))) return_0; -if (!(origin_uuid =build_dm_uuid (mem,seg_lv (seg,0 )->lvid.s,NULL ))) +if (!(origin_uuid =build_dm_uuid (mem,seg_lv (seg,0 ),NULL ))) return_0; if (!dm_tree_node_add_cache_target(node, len,
lib/mirror/mirrored.c +2 -2
@@ -356,14 +356,14 @@ static int _add_log(struct dm_pool *mem, struct lv_segment *seg,if (seg->log_lv) {/* If disk log, use its UUID */ -if (!(log_dlid =build_dm_uuid (mem, seg->log_lv->lvid.s,NULL ))) { +if (!(log_dlid =build_dm_uuid (mem, seg->log_lv,NULL ))) {log_error ("Failed to build uuid for log LV %s." , seg->log_lv->name);return 0 ; } }else {/* If core log, use mirror's UUID and set DM_CORELOG flag */ -if (!(log_dlid =build_dm_uuid (mem, seg->lv->lvid.s,NULL ))) { +if (!(log_dlid =build_dm_uuid (mem, seg->lv,NULL ))) {log_error ("Failed to build uuid for mirror LV %s." , seg->lv->name);return 0 ;
lib/misc/lvm-string.c +4 -1
@@ -15,6 +15,7 @@#include "lib.h" #include "lvm-string.h" +#include "metadata-exported.h" #include <ctype.h>
@@ -160,8 +161,10 @@ int is_reserved_lvname(const char *name)return rc; } -char *build_dm_uuid (struct dm_pool *mem,const char *lvid, +char *build_dm_uuid (struct dm_pool *mem,const struct logical_volume *lv,const char *layer) { +const char *lvid = lv->lvid.s; +return dm_build_dm_uuid (mem,UUID_PREFIX , lvid, layer); }
lib/misc/lvm-string.h +2 -1
@@ -23,6 +23,7 @@#define UUID_PREFIX "LVM-"struct pool ; +struct logical_volume ; typedef enum name_error { NAME_VALID = 0, NAME_INVALID_EMPTY = -1, NAME_INVALID_HYPEN = -2, NAME_INVALID_DOTS = -3,
@@ -32,7 +33,7 @@ typedef enum name_error { NAME_VALID = 0, NAME_INVALID_EMPTY = -1,int emit_to_buffer (char **buffer,size_t *size,const char *fmt, ...) __attribute__ ((format (printf,3 ,4 ))); -char *build_dm_uuid (struct dm_pool *mem,const char *lvid, +char *build_dm_uuid (struct dm_pool *mem,const struct logical_volume *lvid,const char *layer);int validate_name (const char *n);
lib/thin/thin.c +4 -4
@@ -277,13 +277,13 @@ static int _thin_pool_add_target_line(struct dev_manager *dm,return 0 ; } -if (!(metadata_dlid =build_dm_uuid (mem, seg->metadata_lv->lvid.s,NULL ))) { +if (!(metadata_dlid =build_dm_uuid (mem, seg->metadata_lv,NULL ))) {log_error ("Failed to build uuid for metadata LV %s." , seg->metadata_lv->name);return 0 ; } -if (!(pool_dlid =build_dm_uuid (mem,seg_lv (seg,0 )->lvid.s,NULL ))) { +if (!(pool_dlid =build_dm_uuid (mem,seg_lv (seg,0 ),NULL ))) {log_error ("Failed to build uuid for pool LV %s." ,seg_lv (seg,0 )->name);return 0 ;
@@ -535,7 +535,7 @@ static int _thin_add_target_line(struct dev_manager *dm, seg->lv->name);return 0 ; } -if (!(pool_dlid =build_dm_uuid (mem, seg->pool_lv->lvid.s,lv_layer (seg->pool_lv)))) { +if (!(pool_dlid =build_dm_uuid (mem, seg->pool_lv,lv_layer (seg->pool_lv)))) {log_error ("Failed to build uuid for pool LV %s." , seg->pool_lv->name);return 0 ;
@@ -573,7 +573,7 @@ static int _thin_add_target_line(struct dev_manager *dm,return 0 ; } } -if (!(external_dlid =build_dm_uuid (mem, seg->external_lv->lvid.s, +if (!(external_dlid =build_dm_uuid (mem, seg->external_lv,lv_layer (seg->external_lv)))) {log_error ("Failed to build uuid for external origin LV %s." , seg->external_lv->name);