LVM: allow lv_add_segment to use log_areas
PATCH 1/1 LVM: allow lv_add_segment to use log_areas
Patch name: lvm-allow-lv_add_segment-to-use-log_areas.patch
Use the (so far unused) parameter 'log_lv' to determine whether or not to allocate from 'alloced_areas' or 'log_areas'.
RFC: Jonathan Brassow <[email protected]>
lib/metadata/lv_manip.c +11 -4
@@ -1382,6 +1382,15 @@ int lv_add_segment(struct alloc_handle *uint32_t region_size, struct logical_volume *log_lv) { + 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 +*/ + aa_list = (log_lv) ? &ah->log_areas : + &ah->alloced_areas[first_area]; +if (!segtype) {log_error ("Missing segtype in lv_add_segment()." );return 0 ;
@@ -1392,10 +1401,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)) {