1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

liblvm: insert layer with subvolume renames

Rename also subvolumes if we are inserting _tdata layer.
(Currently it breaks mirrors if it would be generic, needs fixing).
This commit is contained in:
Zdenek Kabelac 2012-09-06 15:21:18 +02:00
parent 4648d33d07
commit d442c3ef0c
2 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.98 -
=================================
Enhance insert_layer_for_lv() with recursive rename for _tdata LVs.
Skip building dm tree for thin pool when called with origin_only flag.
Add internal lv_rename_update() to rename LV without updating mda.
Ensure descriptors 0,1,2 are always available.

View File

@ -3795,6 +3795,7 @@ struct logical_volume *insert_layer_for_lv(struct cmd_context *cmd,
struct logical_volume *layer_lv;
struct segment_type *segtype;
struct lv_segment *mapseg;
struct lv_names lv_names;
unsigned exclusive = 0;
/* create an empty layer LV */
@ -3891,6 +3892,18 @@ struct logical_volume *insert_layer_for_lv(struct cmd_context *cmd,
lv_where->le_count = layer_lv->le_count;
lv_where->size = (uint64_t) lv_where->le_count * lv_where->vg->extent_size;
/*
* recuresively rename sub LVs
* currently supported only for thin data layer
* FIXME: without strcmp it breaks mirrors....
*/
if (strcmp(layer_suffix, "_tdata") == 0) {
lv_names.old = lv_where->name;
lv_names.new = layer_lv->name;
if (!for_each_sub_lv(cmd, layer_lv, _rename_cb, (void *) &lv_names))
return 0;
}
return layer_lv;
}