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

[lvm-devel] [PATCH 4/11] Move _find_tmp_mirror()



Move _find_tmp_mirror() for the use by remove_mirror_images().
No functional change.

-- 
Jun'ichi Nomura, NEC Corporation of America
Move _find_tmp_mirror() for the use by remove_mirror_images().
No functional change.

Index: LVM2.work/lib/metadata/mirror.c
===================================================================
--- LVM2.work.orig/lib/metadata/mirror.c
+++ LVM2.work/lib/metadata/mirror.c
@@ -51,6 +51,27 @@ 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 lv_segment *seg;
+
+	if (!(lv->status & MIRRORED))
+		return NULL;
+
+	seg = first_seg(lv);
+
+	/* Temporary mirror is always area_num == 0 */
+	if (seg_type(seg, 0) == AREA_LV &&
+	    is_temporary_mirror_layer(seg_lv(seg, 0)))
+		return seg_lv(seg, 0);
+
+	return NULL;
+}
+
+/*
  * Returns the number of mirrors of the LV
  */
 uint32_t lv_mirror_count(const struct logical_volume *lv)
@@ -499,27 +520,6 @@ static int _mirrored_lv_in_sync(struct l
 }
 
 /*
- * 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 lv_segment *seg;
-
-	if (!(lv->status & MIRRORED))
-		return NULL;
-
-	seg = first_seg(lv);
-
-	/* Temporary mirror is always area_num == 0 */
-	if (seg_type(seg, 0) == AREA_LV &&
-	    is_temporary_mirror_layer(seg_lv(seg, 0)))
-		return seg_lv(seg, 0);
-
-	return NULL;
-}
-
-/*
  * Collapsing temporary mirror layers.
  *
  * When mirrors are added to already-mirrored LV, a temporary mirror layer

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