===================================================================
@@ -1386,6 +1386,18 @@ int lv_add_segment(struct alloc_handle *
uint32_t region_size,
struct logical_volume *log_lv)
{
+ int i;
+ struct dm_list *aa_list;
+
+ /*
+ * We don't actually use the 'log_lv' parameter for anything more
+ * than just figuring out that this allocation is for a log device
+ * It'd be nice to change the arguments type, but the function is
+ * exported.
+ */
+ aa_list = (log_lv) ? &ah->log_areas :
+ &ah->alloced_areas[first_area];
+
if (!segtype) {
log_error("Missing segtype in lv_add_segment().");
return 0;
@@ -1396,10 +1408,8 @@ int lv_add_segment(struct alloc_handle *
return 0;
}
- if (!_setup_alloced_segments(lv, &ah->alloced_areas[first_area],
- num_areas, status,
- stripe_size, segtype,
- region_size))
+ if (!_setup_alloced_segments(lv, aa_list, num_areas, status,
+ stripe_size, segtype, region_size))
return_0;
if ((segtype->flags & SEG_CAN_SPLIT) && !lv_merge_segments(lv)) {