uint32_t raid_rimage_extents(const struct segment_type *segtype,
uint32_t extents, uint32_t stripes, uint32_t data_copies);
uint32_t raid_ensure_min_region_size(const struct logical_volume *lv, uint64_t raid_size, uint32_t region_size);
+int lv_raid_change_region_size(struct logical_volume *lv,
+ int yes, int force, uint32_t new_region_size);
/* -- metadata/raid_manip.c */
/* ++ metadata/cache_manip.c */
region_size, allocate_pvs);
}
+int lv_raid_change_region_size(struct logical_volume *lv,
+ int yes, int force, uint32_t new_region_size)
+{
+ return _region_size_change_requested(lv, yes, new_region_size);
+}
+
static int _remove_partial_multi_segment_image(struct logical_volume *lv,
struct dm_list *remove_pvs)
{
local vg=$4
local lv=$5
- lvconvert --type $type --yes -R $regionsize $vg/$lv
+ lvconvert --yes -R $regionsize $vg/$lv
[ $? -ne 0 ] && return 1
check lv_field $vg/$lv regionsize "$regionsize_str"
fsck -fn "$DM_DEV_DIR/$vg/$lv"
DESC: Convert LV to raid1 or mirror, or change number of mirror images.
RULE: all not lv_is_locked lv_is_pvmove
+lvconvert --regionsize SizeMB LV_raid
+OO: OO_LVCONVERT
+ID: lvconvert_change_region_size
+DESC: Change the region size of an LV.
+RULE: all not lv_is_locked lv_is_pvmove
+RULE: all not LV_raid0
+
---
# lvconvert raid-related utilities
return ret;
}
+static int _lvconvert_change_region_size_single(struct cmd_context *cmd, struct logical_volume *lv,
+ struct processing_handle *handle)
+{
+ if (!lv_raid_change_region_size(lv, arg_is_set(cmd, yes_ARG), arg_count(cmd, force_ARG),
+ arg_int_value(cmd, regionsize_ARG, 0)))
+ return ECMD_FAILED;
+ return ECMD_PROCESSED;
+}
+
+int lvconvert_change_region_size_cmd(struct cmd_context * cmd, int argc, char **argv)
+{
+ return process_each_lv(cmd, 1, cmd->position_argv, NULL, NULL, READ_FOR_UPDATE,
+ NULL, &_lvconvert_visible_check, &_lvconvert_change_region_size_single);
+}
+
/*
* split mirror images
*/
{ lvconvert_split_mirror_images_CMD, lvconvert_split_mirror_images_cmd},
{ lvconvert_change_mirrorlog_CMD, lvconvert_change_mirrorlog_cmd },
{ lvconvert_merge_mirror_images_CMD, lvconvert_merge_mirror_images_cmd },
+ { lvconvert_change_region_size_CMD, lvconvert_change_region_size_cmd },
/* redirected to merge_snapshot/merge_thin/merge_mirrors */
{ lvconvert_merge_CMD, lvconvert_merge_cmd },
int lvconvert_split_mirror_images_cmd(struct cmd_context * cmd, int argc, char **argv);
int lvconvert_merge_mirror_images_cmd(struct cmd_context *cmd, int argc, char **argv);
int lvconvert_change_mirrorlog_cmd(struct cmd_context * cmd, int argc, char **argv);
+int lvconvert_change_region_size_cmd(struct cmd_context * cmd, int argc, char **argv);
int lvconvert_merge_cmd(struct cmd_context *cmd, int argc, char **argv);