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

[lvm-devel] [PATCH pvmove 6/9] Remove unused can_split param from allocate_extents()



'can_split' was a parameter to specify that the allocation should
not be splitted even if the policy is not ALLOC_CONTIGUOUS.
It was there for pvmove, which was not able to handle splitted
allocation.

However, since pvmove now can handle splitted destinations,
we can remove the param from allocate_extents().

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
allocate_extents() no longer need 'can_split' parameter as it's
always 1.

Index: LVM2.work/lib/metadata/lv_manip.c
===================================================================
--- LVM2.work.orig/lib/metadata/lv_manip.c
+++ LVM2.work/lib/metadata/lv_manip.c
@@ -1175,7 +1175,6 @@ struct alloc_handle *allocate_extents(st
 				      uint32_t extents,
 				      struct list *allocatable_pvs,
 				      alloc_policy_t alloc,
-				      unsigned can_split,
 				      struct list *parallel_areas)
 {
 	struct alloc_handle *ah;
@@ -1204,7 +1203,7 @@ struct alloc_handle *allocate_extents(st
 
 	if (!segtype_is_virtual(segtype) &&
 	    !_allocate(ah, vg, lv, (lv ? lv->le_count : 0) + extents,
-		       can_split, allocatable_pvs)) {
+		       1, allocatable_pvs)) {
 		stack;
 		alloc_destroy(ah);
 		return NULL;
@@ -1498,14 +1497,12 @@ int lv_extend(struct logical_volume *lv,
 	uint32_t m;
 	struct alloc_handle *ah;
 	struct lv_segment *seg;
-	unsigned can_split = 1;
 
 	if (segtype_is_virtual(segtype))
 		return lv_add_virtual_segment(lv, status, extents, segtype);
 
 	if (!(ah = allocate_extents(lv->vg, lv, segtype, stripes, mirrors, 0,
-				    extents, allocatable_pvs, alloc, can_split,
-				    NULL)))
+				    extents, allocatable_pvs, alloc, NULL)))
 		return_0;
 
 	if (mirrors < 2) {
Index: LVM2.work/lib/metadata/mirror.c
===================================================================
--- LVM2.work.orig/lib/metadata/mirror.c
+++ LVM2.work/lib/metadata/mirror.c
@@ -802,7 +802,7 @@ int add_mirrors_to_segments(struct cmd_c
 
 	ah = allocate_extents(lv->vg, NULL, segtype,
 			      1, mirrors, 0, lv->le_count,
-			      allocatable_pvs, alloc, 1, parallel_areas);
+			      allocatable_pvs, alloc, parallel_areas);
 	if (!ah) {
 		log_error("Unable to allocate mirror extents.");
 		return 0;
Index: LVM2.work/tools/lvconvert.c
===================================================================
--- LVM2.work.orig/tools/lvconvert.c
+++ LVM2.work/tools/lvconvert.c
@@ -339,7 +339,7 @@ static int lvconvert_mirrors(struct cmd_
 					    1, lp->mirrors - 1,
 					    corelog ? 0U : 1U,
 					    lv->le_count, lp->pvh, lp->alloc,
-					    1, parallel_areas)))
+					    parallel_areas)))
 			return_0;
 
 		lp->region_size = adjusted_mirror_region_size(lv->vg->extent_size,
@@ -385,7 +385,7 @@ static int lvconvert_mirrors(struct cmd_
 
 			if (!(ah = allocate_extents(lv->vg, NULL, lp->segtype, 0,
 						    0, 1, 0, lp->pvh, lp->alloc,
-						    1, parallel_areas))) {
+						    parallel_areas))) {
 				stack;
 				return 0;
 			}
Index: LVM2.work/tools/lvcreate.c
===================================================================
--- LVM2.work.orig/tools/lvcreate.c
+++ LVM2.work/tools/lvcreate.c
@@ -750,7 +750,7 @@ static int _lvcreate(struct cmd_context 
 
 		if (!(ah = allocate_extents(vg, NULL, lp->segtype, lp->stripes,
 					    lp->mirrors, lp->corelog ? 0U : 1U,
-					    lp->extents, pvh, lp->alloc, 1, NULL)))
+					    lp->extents, pvh, lp->alloc, NULL)))
 			return_0;
 
 		lp->region_size = adjusted_mirror_region_size(vg->extent_size,
Index: LVM2.work/lib/metadata/lv_alloc.h
===================================================================
--- LVM2.work.orig/lib/metadata/lv_alloc.h
+++ LVM2.work/lib/metadata/lv_alloc.h
@@ -50,7 +50,6 @@ struct alloc_handle *allocate_extents(st
 				      uint32_t extents,
                                       struct list *allocatable_pvs,
 				      alloc_policy_t alloc,
-				      unsigned can_split,
 				      struct list *parallel_areas);
 
 int lv_add_segment(struct alloc_handle *ah,

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