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

[lvm-devel] [PATCH LVM2] (6/12) move _add_pvs() to the earlier part of the file



This move the location of _add_pvs() for later patches.
No funtional change.


$ diffstat -p1 06.add_pvs.patch
 lib/metadata/lv_manip.c |   50 +++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-)


-- 
Jun'ichi Nomura, NEC Corporation of America


diff -X dontdiff -urp LVM2.05.prefer_small/lib/metadata/lv_manip.c LVM2.06.add_pvs/lib/metadata/lv_manip.c
--- LVM2.05.prefer_small/lib/metadata/lv_manip.c	2006-10-13 21:16:42.000000000 -0400
+++ LVM2.06.add_pvs/lib/metadata/lv_manip.c	2006-10-13 21:19:01.000000000 -0400
@@ -740,6 +740,33 @@ static int _setup_alloced_segments(struc
 }
 
 /*
+ * add pv to seg_pvs
+ * (called directly or called back from _for_each_pv())
+ */
+static int _add_pvs(struct cmd_context *cmd, struct pv_segment *peg,
+		    uint32_t s __attribute((unused)), void *data)
+{
+	struct seg_pvs *spvs = (struct seg_pvs *) data;
+	struct pv_list *pvl;
+
+	/* Don't add again if it's already on list. */
+	list_iterate_items(pvl, &spvs->pvs)
+		if (pvl->pv == peg->pv)
+			return 1;
+
+	if (!(pvl = dm_pool_alloc(cmd->mem, sizeof(*pvl)))) {
+		log_error("pv_list allocation failed");
+		return 0;
+	}
+
+	pvl->pv = peg->pv;
+
+	list_add(&spvs->pvs, &pvl->list);
+
+	return 1;
+}
+
+/*
  * returns seg_pvs which contains the le from the list
  */
 static struct seg_pvs* _find_seg_pvs(struct list *list, uint32_t le)
@@ -1838,29 +1865,6 @@ struct logical_volume *lv_create_empty(s
 	return lv;
 }
 
-static int _add_pvs(struct cmd_context *cmd, struct pv_segment *peg,
-		    uint32_t s __attribute((unused)), void *data)
-{
-	struct seg_pvs *spvs = (struct seg_pvs *) data;
-	struct pv_list *pvl;
-
-	/* Don't add again if it's already on list. */
-	list_iterate_items(pvl, &spvs->pvs)
-		if (pvl->pv == peg->pv)
-			return 1;
-
-	if (!(pvl = dm_pool_alloc(cmd->mem, sizeof(*pvl)))) {
-		log_error("pv_list allocation failed");
-		return 0;
-	}
-
-	pvl->pv = peg->pv;
-
-	list_add(&spvs->pvs, &pvl->list);
-
-	return 1;
-}
-
 /*
  * Construct list of segments of LVs showing which PVs they use.
  */

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