unsigned long long start, size;
};
+/* definitions of reshape process types */
+enum imsm_reshape_type {
+ CH_TAKEOVER,
+ CH_CHUNK_MIGR,
+ CH_LEVEL_MIGRATION
+};
+
/* definition of messages passed to imsm_process_update */
enum imsm_update_type {
update_activate_spare,
struct geo_params *geo,
int *old_raid_disks)
{
+ /* currently we only support increasing the number of devices
+ * for a container. This increases the number of device for each
+ * member array. They must all be RAID0 or RAID5.
+ */
int ret_val = 0;
struct mdinfo *info, *member;
int devices_that_can_grow = 0;
}
}
+/*******************************************************************************
+* Function: imsm_analyze_change
+* Description: Function analyze and validate change for single volume migration
+* Parameters: Geometry parameters, supertype structure
+* Returns: Operation type code on success, -1 if fail
+********************************************************************************/
+enum imsm_reshape_type imsm_analyze_change(
+ struct supertype *st, struct geo_params *geo)
+{
+ return -1;
+}
+
static int imsm_reshape_super(struct supertype *st, long long size, int level,
int layout, int chunksize, int raid_disks,
char *backup, char *dev, int verbose)
{
- /* currently we only support increasing the number of devices
- * for a container. This increases the number of device for each
- * member array. They must all be RAID0 or RAID5.
- */
-
int ret_val = 1;
struct geo_params geo;
memset(&geo, sizeof(struct geo_params), 0);
geo.dev_name = dev;
+ geo.dev_id = st->devnum;
geo.size = size;
geo.level = level;
geo.layout = layout;
if (experimental() == 0)
return ret_val;
- /* verify reshape conditions
- * on container level we can only increase number of devices.
- */
if (st->container_dev == st->devnum) {
- /* check for delta_disks > 0
- * and supported raid levels 0 and 5 only in container
- */
+ /* On container level we can only increase number of devices. */
+ dprintf("imsm: info: Container operation\n");
int old_raid_disks = 0;
if (imsm_reshape_is_allowed_on_container(
st, &geo, &old_raid_disks)) {
else
free(u);
- } else
+ } else {
fprintf(stderr, Name "imsm: Operation is not allowed "
"on this container\n");
- } else
- fprintf(stderr, Name "imsm: not a container operation\n");
+ }
+ } else {
+ /* On volume level we support following operations
+ * - takeover: raid10 -> raid0; raid0 -> raid10
+ * - chunk size migration
+ * - migration: raid5 -> raid0; raid0 -> raid5
+ */
+ int change;
+ dprintf("imsm: info: Volume operation\n");
+ change = imsm_analyze_change(st, &geo);
+ switch (change) {
+ case CH_TAKEOVER:
+ break;
+ case CH_CHUNK_MIGR:
+ break;
+ case CH_LEVEL_MIGRATION:
+ break;
+ }
+ ret_val = 0;
+ }
exit_imsm_reshape_super:
dprintf("imsm: reshape_super Exit code = %i\n", ret_val);