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

[lvm-devel] [LVM2 PATCH] (4/5) Remove unnecessary prev_lvseg checks



In _find_parallel_space(), contiguous and cling are set
only when prev_lvseg != NULL.
So there is no need to check it again.


Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
In _find_parallel_space(), contiguous and cling are set
only when prev_lvseg != NULL.
So there is no need to check it again.


Index: LVM2.02.17/lib/metadata/lv_manip.c
===================================================================
--- LVM2.02.17.orig/lib/metadata/lv_manip.c	2007-01-06 01:33:40.000000000 -0500
+++ LVM2.02.17/lib/metadata/lv_manip.c	2007-01-06 01:34:40.000000000 -0500
@@ -934,6 +934,9 @@ static int _find_parallel_space(struct a
 			ix_offset = 0;
 	}
 
+	/* ix_offset, preferred_count, contiguous and cling are non-zero
+	   only when prev_lvseg is not NULL */
+
 	/* FIXME This algorithm needs a lot of cleaning up! */
 	/* FIXME anywhere doesn't find all space yet */
 	/* ix_offset holds the number of allocations that must be contiguous */
@@ -998,8 +1001,7 @@ static int _find_parallel_space(struct a
 			/* First area in each list is the largest */
 			list_iterate_items(pva, &pvm->areas) {
 				if (contiguous) {
-					if (prev_lvseg &&
-					    _check_contiguous(ah->cmd,
+					if (_check_contiguous(ah->cmd,
 							      prev_lvseg,
 							      pva, areas,
 							      areas_size)) {
@@ -1010,8 +1012,7 @@ static int _find_parallel_space(struct a
 				}
 
 				if (cling) {
-					if (prev_lvseg &&
-					    _check_cling(ah->cmd,
+					if (_check_cling(ah->cmd,
 							   prev_lvseg,
 							   pva, areas,
 							   areas_size)) {

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