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

[lvm-devel] [LVM2 PATCH] (4/5) Remove unused parameters from allocate_extents() [resending with the patch]



[Resending with the patch.]

This patch removes unused 'status' parameter from allocate_extents().

Guessing from the lv_extend(), 'status' is related to lv->status.
However, allocate_extents() only allocates extents.
Mapping extents to LV segment is done in other functions.
So the parameter seems no use in future, too.

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
Removing 'status' parameter from allocate_extents()

'status' is used in functions like lv_add_segment() to be set to lv->status.
Since allocate_extents() does nothing about lv->status, it doesn't
need to take the parameter.
Actually, it isn't used in the current code.

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 physical_volume *mirrored_pv,
                                       uint32_t mirrored_pe,
-                                      uint32_t status,
                                       struct list *allocatable_pvs,
 				      alloc_policy_t alloc,
 				      struct list *parallel_areas);
Index: LVM2.work/lib/metadata/lv_manip.c
===================================================================
--- LVM2.work.orig/lib/metadata/lv_manip.c
+++ LVM2.work/lib/metadata/lv_manip.c
@@ -1203,7 +1203,6 @@ struct alloc_handle *allocate_extents(st
 				      uint32_t extents,
 				      struct physical_volume *mirrored_pv,
 				      uint32_t mirrored_pe,
-				      uint32_t status,
 				      struct list *allocatable_pvs,
 				      alloc_policy_t alloc,
 				      struct list *parallel_areas)
@@ -1437,7 +1436,7 @@ int lv_extend(struct logical_volume *lv,
 		return lv_add_virtual_segment(lv, status, extents, segtype);
 
 	if (!(ah = allocate_extents(lv->vg, lv, segtype, stripes, mirrors, 0,
-				    extents, mirrored_pv, mirrored_pe, status,
+				    extents, mirrored_pv, mirrored_pe,
 				    allocatable_pvs, alloc, NULL))) {
 		stack;
 		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 ? 0 : 1,
 					    lv->le_count,
-					    NULL, 0, 0, lp->pvh,
+					    NULL, 0, lp->pvh,
 					    lp->alloc,
 					    parallel_areas)))
 			return_0;
@@ -387,7 +387,7 @@ static int lvconvert_mirrors(struct cmd_
 
 			if (!(ah = allocate_extents(lv->vg, NULL, lp->segtype, 0,
 						    0, 1, 0,
-						    NULL, 0, 0, lp->pvh,
+						    NULL, 0, lp->pvh,
 						    lp->alloc,
 						    parallel_areas))) {
 				stack;
Index: LVM2.work/tools/lvcreate.c
===================================================================
--- LVM2.work.orig/tools/lvcreate.c
+++ LVM2.work/tools/lvcreate.c
@@ -708,7 +708,7 @@ static int _lvcreate(struct cmd_context 
 
 		if (!(ah = allocate_extents(vg, NULL, lp->segtype, lp->stripes,
 					    lp->mirrors, lp->corelog ? 0 : 1,
-					    lp->extents, NULL, 0, 0,
+					    lp->extents, NULL, 0,
 					    pvh, lp->alloc, NULL))) {
 			stack;
 			return 0;

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