int lv_is_raid_with_tracking(const struct logical_volume *lv);
uint32_t lv_raid_image_count(const struct logical_volume *lv);
int lv_raid_change_image_count(struct logical_volume *lv,
- uint32_t new_count, struct dm_list *pvs);
+ uint32_t new_count, struct dm_list *allocate_pvs);
int lv_raid_split(struct logical_volume *lv, const char *split_name,
uint32_t new_count, struct dm_list *splittable_pvs);
int lv_raid_split_and_track(struct logical_volume *lv,
}
/*
- * lv_raid_change_image_count
- * @lv
- * @new_count: The absolute count of images (e.g. '2' for a 2-way mirror)
- * @pvs: The list of PVs that are candidates for removal (or empty list)
+ * _lv_raid_change_image_count
+ * new_count: The absolute count of images (e.g. '2' for a 2-way mirror)
+ * allocate_pvs: The list of PVs that are candidates for removal (or empty list)
*
* RAID arrays have 'images' which are composed of two parts, they are:
* - 'rimage': The data/parity holding portion
* - 'rmeta' : The metadata holding portion (i.e. superblock/bitmap area)
* This function adds or removes _both_ portions of the image and commits
* the results.
- *
- * Returns: 1 on success, 0 on failure
*/
-int lv_raid_change_image_count(struct logical_volume *lv,
- uint32_t new_count, struct dm_list *pvs)
+static int _lv_raid_change_image_count(struct logical_volume *lv, uint32_t new_count,
+ struct dm_list *allocate_pvs, struct dm_list *removal_lvs)
{
uint32_t old_count = lv_raid_image_count(lv);
}
if (old_count > new_count)
- return _raid_remove_images(lv, new_count, pvs);
+ return _raid_remove_images(lv, new_count, allocate_pvs);
- return _raid_add_images(lv, new_count, pvs);
+ return _raid_add_images(lv, new_count, allocate_pvs);
+}
+
+int lv_raid_change_image_count(struct logical_volume *lv, uint32_t new_count,
+ struct dm_list *allocate_pvs)
+{
+ return _lv_raid_change_image_count(lv, new_count, allocate_pvs, NULL);
}
int lv_raid_split(struct logical_volume *lv, const char *split_name,
return 1;
}
+
/* Add new @lvs to @lv at @area_offset */
static int _add_image_component_list(struct lv_segment *seg, int delete_from_list,
uint64_t lv_flags, struct dm_list *lvs, uint32_t area_offset)