[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH 6/11] Export find_tmp_mirror()



Export find_tmp_mirror() for use by lvconvert to
walk down the converting LV stack.

-- 
Jun'ichi Nomura, NEC Corporation of America
Export find_tmp_mirror() for use by lvconvert to
walk down the converting LV stack.

Index: LVM2.work/lib/metadata/metadata-exported.h
===================================================================
--- LVM2.work.orig/lib/metadata/metadata-exported.h
+++ LVM2.work/lib/metadata/metadata-exported.h
@@ -471,6 +471,7 @@ int lv_remove_mirrors(struct cmd_context
 		      struct list *pvs, uint32_t status_mask);
 
 int is_temporary_mirror_layer(const struct logical_volume *lv);
+struct logical_volume * find_tmp_mirror(const struct logical_volume *lv);
 uint32_t lv_mirror_count(const struct logical_volume *lv);
 uint32_t adjusted_mirror_region_size(uint32_t extent_size, uint32_t extents,
                                     uint32_t region_size);
Index: LVM2.work/lib/metadata/mirror.c
===================================================================
--- LVM2.work.orig/lib/metadata/mirror.c
+++ LVM2.work/lib/metadata/mirror.c
@@ -54,7 +54,7 @@ int is_temporary_mirror_layer(const stru
  * Return a temporary LV for resyncing added mirror image.
  * Add other mirror legs to lvs list.
  */
-static struct logical_volume *_find_tmp_mirror(struct logical_volume *lv)
+struct logical_volume *find_tmp_mirror(const struct logical_volume *lv)
 {
 	struct lv_segment *seg;
 
@@ -541,7 +541,7 @@ int collapse_mirrored_lv(struct logical_
 	struct logical_volume *tmp_lv;
 	struct lv_segment *mirror_seg;
 
-	while ((tmp_lv = _find_tmp_mirror(lv))) {
+	while ((tmp_lv = find_tmp_mirror(lv))) {
 		mirror_seg = find_mirror_seg(first_seg(tmp_lv));
 		if (!mirror_seg) {
 			log_error("Failed to find mirrored LV for %s",

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]