mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-01 09:47:48 +03:00
remove superfluous raid5_0 and raid6_0_6 mappings; support -m with linear <-> raid4/5
This commit is contained in:
parent
08ab60d979
commit
a761ddb772
@ -130,7 +130,6 @@ enum _lv_type_name_enum {
|
||||
LV_TYPE_RAID10,
|
||||
LV_TYPE_RAID4,
|
||||
LV_TYPE_RAID5,
|
||||
LV_TYPE_RAID5_0,
|
||||
LV_TYPE_RAID5_N,
|
||||
LV_TYPE_RAID5_LA,
|
||||
LV_TYPE_RAID5_RA,
|
||||
@ -144,7 +143,7 @@ enum _lv_type_name_enum {
|
||||
LV_TYPE_RAID6_RA_6,
|
||||
LV_TYPE_RAID6_LS_6,
|
||||
LV_TYPE_RAID6_RS_6,
|
||||
LV_TYPE_RAID6_0_6
|
||||
LV_TYPE_RAID6_N_6,
|
||||
};
|
||||
|
||||
static const char *_lv_type_names[] = {
|
||||
@ -183,7 +182,6 @@ static const char *_lv_type_names[] = {
|
||||
[LV_TYPE_RAID10] = SEG_TYPE_NAME_RAID10,
|
||||
[LV_TYPE_RAID4] = SEG_TYPE_NAME_RAID4,
|
||||
[LV_TYPE_RAID5] = SEG_TYPE_NAME_RAID5,
|
||||
[LV_TYPE_RAID5_0] = SEG_TYPE_NAME_RAID5_0,
|
||||
[LV_TYPE_RAID5_N] = SEG_TYPE_NAME_RAID5_N,
|
||||
[LV_TYPE_RAID5_LA] = SEG_TYPE_NAME_RAID5_LA,
|
||||
[LV_TYPE_RAID5_RA] = SEG_TYPE_NAME_RAID5_RA,
|
||||
@ -197,7 +195,7 @@ static const char *_lv_type_names[] = {
|
||||
[LV_TYPE_RAID6_RA_6] = SEG_TYPE_NAME_RAID6_RA_6,
|
||||
[LV_TYPE_RAID6_LS_6] = SEG_TYPE_NAME_RAID6_LS_6,
|
||||
[LV_TYPE_RAID6_RS_6] = SEG_TYPE_NAME_RAID6_RS_6,
|
||||
[LV_TYPE_RAID6_0_6] = SEG_TYPE_NAME_RAID6_0_6,
|
||||
[LV_TYPE_RAID6_N_6] = SEG_TYPE_NAME_RAID6_N_6,
|
||||
};
|
||||
|
||||
static int _lv_layout_and_role_mirror(struct dm_pool *mem,
|
||||
@ -289,7 +287,7 @@ static int _lv_layout_and_role_raid(struct dm_pool *mem,
|
||||
!str_list_add_no_dup_check(mem, layout, _lv_type_names[LV_TYPE_RAID6]))
|
||||
return 0;
|
||||
|
||||
for (t = LV_TYPE_RAID0; t <= LV_TYPE_RAID6_0_6; t++)
|
||||
for (t = LV_TYPE_RAID0; t <= LV_TYPE_RAID6_N_6; t++)
|
||||
if (!strcmp(segtype_name, _lv_type_names[t])) {
|
||||
if (str_list_add_no_dup_check(mem, layout, _lv_type_names[t]))
|
||||
break;
|
||||
|
@ -1304,7 +1304,7 @@ static int _lv_alloc_reshape_space(struct logical_volume *lv,
|
||||
struct dm_list *allocate_pvs)
|
||||
{
|
||||
/* Reshape LEs per disk minimum one MiB for now... */
|
||||
uint32_t out_of_place_les_per_disk = max(2048 / (unsigned long long) lv->vg->extent_size, 1);
|
||||
uint32_t out_of_place_les_per_disk = max(2048ULL / (unsigned long long) lv->vg->extent_size, 1ULL);
|
||||
uint64_t data_offset, dev_sectors;
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
|
||||
@ -1348,19 +1348,23 @@ PFLA("data_offset=%llu dev_sectors=%llu seg->reshape_len=%u out_of_place_les_per
|
||||
seg->reshape_len = reshape_len;
|
||||
}
|
||||
|
||||
seg->data_offset = 0;
|
||||
|
||||
/*
|
||||
* Handle reshape space relocation
|
||||
*/
|
||||
switch (where) {
|
||||
case alloc_begin:
|
||||
/* Kernel says we have it at the end -> relocate it to the begin */
|
||||
if (!data_offset && !_relocate_reshape_space(lv, 0))
|
||||
if (!data_offset &&
|
||||
!_relocate_reshape_space(lv, 0))
|
||||
return_0;
|
||||
break;
|
||||
|
||||
case alloc_end:
|
||||
/* Kernel says we have it at the beginning -> relocate it to the end */
|
||||
if (data_offset && !_relocate_reshape_space(lv, 1))
|
||||
if (data_offset &&
|
||||
!_relocate_reshape_space(lv, 1))
|
||||
return_0;
|
||||
break;
|
||||
|
||||
@ -1369,11 +1373,11 @@ PFLA("data_offset=%llu dev_sectors=%llu seg->reshape_len=%u out_of_place_les_per
|
||||
break;
|
||||
|
||||
default:
|
||||
log_error(INTERNAL_ERROR, "Bogus reshape space allocation request");
|
||||
log_error(INTERNAL_ERROR "Bogus reshape space allocation request");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Inform kernel about the reshape lenght in sectors */
|
||||
/* Inform kernel about the reshape length in sectors */
|
||||
seg->data_offset = _reshape_les_per_dev(seg) * lv->vg->extent_size;
|
||||
|
||||
/* At least try merging segments */
|
||||
@ -1475,6 +1479,7 @@ static int _convert_linear_to_raid(struct logical_volume *lv)
|
||||
{
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
uint32_t region_size = seg->region_size;
|
||||
uint32_t stripe_size = seg->stripe_size;
|
||||
|
||||
if (!_insert_raid_layer_for_lv(lv, "_rimage_0", 0))
|
||||
return 0;
|
||||
@ -1483,6 +1488,7 @@ static int _convert_linear_to_raid(struct logical_volume *lv)
|
||||
seg = first_seg(lv);
|
||||
seg_lv(seg, 0)->status |= RAID_IMAGE | LVM_READ | LVM_WRITE;
|
||||
seg->region_size = region_size;
|
||||
seg->stripe_size = stripe_size;
|
||||
_check_and_init_region_size(lv);
|
||||
|
||||
return 1;
|
||||
@ -1786,8 +1792,8 @@ PFLA("lv->le_count=%u data_rimages=%u plus_extents=%u", lv->le_count, _data_rima
|
||||
seg->area_len += plus_extents;
|
||||
seg->reshape_len = seg->reshape_len / _data_rimages_count(seg, old_count) *
|
||||
_data_rimages_count(seg, new_count);
|
||||
if (old_count == 2)
|
||||
seg->stripe_size = 64 * 2;
|
||||
if (old_count == 2 && !seg->stripe_size)
|
||||
seg->stripe_size = DEFAULT_STRIPESIZE;
|
||||
PFLA("lv->le_count=%u", lv->le_count);
|
||||
}
|
||||
|
||||
@ -2061,8 +2067,6 @@ PFLA("lv->le_count=%u data_rimages=%u minus_extents=%u", lv->le_count, _data_rim
|
||||
seg->area_len -= minus_extents;
|
||||
seg->reshape_len = seg->reshape_len / _data_rimages_count(seg, old_count) *
|
||||
_data_rimages_count(seg, new_count);
|
||||
if (new_count == 2)
|
||||
seg->stripe_size = 0;
|
||||
PFLA("lv->le_count=%u", lv->le_count);
|
||||
}
|
||||
|
||||
@ -2208,6 +2212,7 @@ PFLA("segtype=%s old_count=%u new_count=%u", segtype->name, old_count, new_count
|
||||
/* Check for maximum supported raid devices */
|
||||
if (!_check_maximum_devices(new_count))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* LV must be either in-active or exclusively active
|
||||
*/
|
||||
@ -2827,6 +2832,7 @@ static int _convert_striped_to_raid0(struct logical_volume *lv,
|
||||
|
||||
/* Allocate new top-level LV segment using credentials of first ne data lv for stripe_size... */
|
||||
data_lv_seg = first_seg(dm_list_item(dm_list_first(&new_data_lvs), struct lv_list)->lv);
|
||||
data_lv_seg->stripe_size = seg->stripe_size;
|
||||
if (!_striped_to_raid0_alloc_raid0_segment(lv, area_count, data_lv_seg)) {
|
||||
log_error("Failed to allocate new raid0 segement for LV %s/%s.", lv->vg->name, lv->name);
|
||||
return_0;
|
||||
@ -3494,7 +3500,7 @@ static int _raid_level_down(struct logical_volume *lv,
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*a))
|
||||
struct possible_type {
|
||||
const char *current_type;
|
||||
const char *possible_types[14];
|
||||
const char *possible_types[13];
|
||||
};
|
||||
static const struct segment_type *_adjust_segtype(struct logical_volume *lv,
|
||||
const struct segment_type *segtype,
|
||||
@ -3530,47 +3536,39 @@ static const struct segment_type *_adjust_segtype(struct logical_volume *lv,
|
||||
SEG_TYPE_NAME_RAID6_N_6, NULL } },
|
||||
{ .current_type = SEG_TYPE_NAME_RAID5,
|
||||
.possible_types = { SEG_TYPE_NAME_RAID1,
|
||||
SEG_TYPE_NAME_RAID5_0, SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5_LS, SEG_TYPE_NAME_RAID5_RS,
|
||||
SEG_TYPE_NAME_RAID5_LA, SEG_TYPE_NAME_RAID5_RA,
|
||||
SEG_TYPE_NAME_RAID6_LS_6, NULL } },
|
||||
{ .current_type = SEG_TYPE_NAME_RAID5_LS,
|
||||
.possible_types = { SEG_TYPE_NAME_RAID1,
|
||||
SEG_TYPE_NAME_RAID5, SEG_TYPE_NAME_RAID5_0, SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5, SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5_RS,
|
||||
SEG_TYPE_NAME_RAID5_LA, SEG_TYPE_NAME_RAID5_RA,
|
||||
SEG_TYPE_NAME_RAID6_LS_6, NULL } },
|
||||
{ .current_type = SEG_TYPE_NAME_RAID5_RS,
|
||||
.possible_types = { SEG_TYPE_NAME_RAID1,
|
||||
SEG_TYPE_NAME_RAID5, SEG_TYPE_NAME_RAID5_0, SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5, SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5_LS,
|
||||
SEG_TYPE_NAME_RAID5_LA, SEG_TYPE_NAME_RAID5_RA,
|
||||
SEG_TYPE_NAME_RAID6_RS_6, NULL } },
|
||||
{ .current_type = SEG_TYPE_NAME_RAID5_LA,
|
||||
.possible_types = { SEG_TYPE_NAME_RAID1,
|
||||
SEG_TYPE_NAME_RAID5, SEG_TYPE_NAME_RAID5_0, SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5, SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5_LS, SEG_TYPE_NAME_RAID5_RS,
|
||||
SEG_TYPE_NAME_RAID5_RA,
|
||||
SEG_TYPE_NAME_RAID6_LA_6, NULL } },
|
||||
{ .current_type = SEG_TYPE_NAME_RAID5_RA,
|
||||
.possible_types = { SEG_TYPE_NAME_RAID1,
|
||||
SEG_TYPE_NAME_RAID5, SEG_TYPE_NAME_RAID5_0, SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5, SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5_LS, SEG_TYPE_NAME_RAID5_RS,
|
||||
SEG_TYPE_NAME_RAID5_LA,
|
||||
SEG_TYPE_NAME_RAID6_RA_6, NULL } },
|
||||
{ .current_type = SEG_TYPE_NAME_RAID5_0,
|
||||
.possible_types = { SEG_TYPE_NAME_RAID1,
|
||||
SEG_TYPE_NAME_RAID4,
|
||||
SEG_TYPE_NAME_RAID5, SEG_TYPE_NAME_RAID5_N,
|
||||
SEG_TYPE_NAME_RAID5_LS, SEG_TYPE_NAME_RAID5_RS,
|
||||
SEG_TYPE_NAME_RAID5_LA, SEG_TYPE_NAME_RAID5_RA,
|
||||
SEG_TYPE_NAME_RAID6_0_6, NULL } },
|
||||
{ .current_type = SEG_TYPE_NAME_RAID5_N,
|
||||
.possible_types = { SEG_TYPE_NAME_LINEAR, SEG_TYPE_NAME_STRIPED,
|
||||
SEG_TYPE_NAME_RAID0, SEG_TYPE_NAME_RAID0_META,
|
||||
SEG_TYPE_NAME_RAID1,
|
||||
SEG_TYPE_NAME_RAID4,
|
||||
SEG_TYPE_NAME_RAID5, SEG_TYPE_NAME_RAID5_0,
|
||||
SEG_TYPE_NAME_RAID4, SEG_TYPE_NAME_RAID5,
|
||||
SEG_TYPE_NAME_RAID5_LS, SEG_TYPE_NAME_RAID5_RS,
|
||||
SEG_TYPE_NAME_RAID5_LA, SEG_TYPE_NAME_RAID5_RA,
|
||||
SEG_TYPE_NAME_RAID6_N_6, NULL } },
|
||||
@ -3832,15 +3830,21 @@ int lv_raid_convert(struct logical_volume *lv,
|
||||
struct lv_segment *seg = first_seg(lv);
|
||||
const struct segment_type *final_segtype = NULL;
|
||||
const struct segment_type *new_segtype_tmp = new_segtype;
|
||||
const struct segment_type *raid0_segtype, *striped_segtype;
|
||||
const struct segment_type *linear_segtype, *striped_segtype, *raid0_segtype, *raid1_segtype;
|
||||
struct lvinfo info = { 0 };
|
||||
|
||||
if (!(linear_segtype = get_segtype_from_string(lv->vg->cmd, SEG_TYPE_NAME_LINEAR)))
|
||||
return_0;
|
||||
|
||||
if (!(striped_segtype = get_segtype_from_string(lv->vg->cmd, SEG_TYPE_NAME_STRIPED)))
|
||||
return_0;
|
||||
|
||||
if (!(raid0_segtype = get_segtype_from_string(lv->vg->cmd, SEG_TYPE_NAME_RAID0)))
|
||||
return_0;
|
||||
|
||||
if (!(raid1_segtype = get_segtype_from_string(lv->vg->cmd, SEG_TYPE_NAME_RAID1)))
|
||||
return_0;
|
||||
|
||||
if (!new_segtype) {
|
||||
log_error(INTERNAL_ERROR "New segtype not specified");
|
||||
return 0;
|
||||
@ -3891,8 +3895,11 @@ PFLA("new_image_count=%u new_stripes=%u seg->area_count=%u", new_image_count, ne
|
||||
_seg_get_redundancy(seg->segtype, seg->area_count, &cur_redundancy);
|
||||
_seg_get_redundancy(new_segtype, new_image_count = new_image_count ?: lv_raid_image_count(lv), &new_redundancy);
|
||||
|
||||
if (seg_is_raid1(seg) && new_image_count == 1)
|
||||
new_segtype_tmp = striped_segtype;
|
||||
if (((seg_is_raid4(seg) && seg->area_count == 2) ||
|
||||
(seg_is_any_raid5(seg) && seg->area_count == 2) ||
|
||||
seg_is_raid1(seg)) &&
|
||||
new_image_count == 1)
|
||||
new_segtype_tmp = linear_segtype;
|
||||
|
||||
/*
|
||||
* In case of any resilience related conversion -> ask the user unless "-y/--yes" on command line
|
||||
@ -3906,7 +3913,7 @@ PFLA("cur_redundancy=%u new_redundancy=%u", cur_redundancy, new_redundancy);
|
||||
"resilience of %u disk failure%s",
|
||||
info.open_count ? " and open" : "", lv->vg->name, lv->name,
|
||||
seg->segtype != new_segtype_tmp ? "from " : "",
|
||||
seg->segtype != new_segtype_tmp ? _get_segtype_name(seg->segtype, new_image_count) : "",
|
||||
seg->segtype != new_segtype_tmp ? _get_segtype_name(seg->segtype, seg->area_count) : "",
|
||||
seg->segtype != new_segtype_tmp ? " to " : "",
|
||||
seg->segtype != new_segtype_tmp ? _get_segtype_name(new_segtype_tmp, new_image_count) : "",
|
||||
cur_redundancy,
|
||||
@ -3920,7 +3927,7 @@ PFLA("cur_redundancy=%u new_redundancy=%u", cur_redundancy, new_redundancy);
|
||||
"resilience from %u disk failure%s to %u",
|
||||
info.open_count ? " and open" : "", lv->vg->name, lv->name,
|
||||
seg->segtype != new_segtype_tmp ? "from " : "",
|
||||
seg->segtype != new_segtype_tmp ? _get_segtype_name(seg->segtype, new_image_count) : "",
|
||||
seg->segtype != new_segtype_tmp ? _get_segtype_name(seg->segtype, seg->area_count) : "",
|
||||
seg->segtype != new_segtype_tmp ? " to " : "",
|
||||
seg->segtype != new_segtype_tmp ? _get_segtype_name(new_segtype_tmp, new_image_count) : "",
|
||||
cur_redundancy,
|
||||
@ -3933,7 +3940,7 @@ PFLA("cur_redundancy=%u new_redundancy=%u", cur_redundancy, new_redundancy);
|
||||
"resilience from %u disk failures to just %u",
|
||||
info.open_count ? " and open" : "", lv->vg->name, lv->name,
|
||||
seg->segtype != new_segtype_tmp ? "from " : "",
|
||||
seg->segtype != new_segtype_tmp ? _get_segtype_name(seg->segtype, new_image_count) : "",
|
||||
seg->segtype != new_segtype_tmp ? _get_segtype_name(seg->segtype, seg->area_count) : "",
|
||||
seg->segtype != new_segtype_tmp ? " to " : "",
|
||||
seg->segtype != new_segtype_tmp ? _get_segtype_name(new_segtype_tmp, new_image_count) : "",
|
||||
cur_redundancy, new_redundancy);
|
||||
@ -3942,16 +3949,19 @@ PFLA("cur_redundancy=%u new_redundancy=%u", cur_redundancy, new_redundancy);
|
||||
log_warn("WARNING: Converting active%s %s/%s from %s to %s will loose "
|
||||
"all resilience to %u disk failure%s",
|
||||
info.open_count ? " and open" : "", lv->vg->name, lv->name,
|
||||
_get_segtype_name(seg->segtype, new_image_count),
|
||||
_get_segtype_name(seg->segtype, seg->area_count),
|
||||
_get_segtype_name(new_segtype_tmp, new_image_count),
|
||||
cur_redundancy, cur_redundancy > 1 ? "s" : "");
|
||||
|
||||
else
|
||||
y = 1;
|
||||
|
||||
if (seg_is_linear(seg) && new_image_count == 2)
|
||||
new_segtype_tmp = raid1_segtype;
|
||||
|
||||
if (!y && yes_no_prompt("Do you really want to convert %s/%s with type %s to %s? [y/n]: ",
|
||||
lv->vg->name, lv->name,
|
||||
_get_segtype_name(seg->segtype, new_image_count),
|
||||
_get_segtype_name(seg->segtype, seg->area_count),
|
||||
_get_segtype_name(new_segtype_tmp, new_image_count)) == 'n') {
|
||||
log_error("Logical volume %s/%s NOT converted", lv->vg->name, lv->name);
|
||||
return 0;
|
||||
@ -3959,12 +3969,13 @@ PFLA("cur_redundancy=%u new_redundancy=%u", cur_redundancy, new_redundancy);
|
||||
if (sigint_caught())
|
||||
return_0;
|
||||
|
||||
|
||||
/* Now archive after the user has confirmed */
|
||||
if (!archive(lv->vg))
|
||||
return_0;
|
||||
|
||||
|
||||
new_segtype = new_segtype_tmp;
|
||||
|
||||
PFLA("seg_is_linear(seg)=%d", seg_is_linear(seg));
|
||||
/*
|
||||
* Linear(raid0 <-> raid0/1/4/5 conversions _or_ change image count of raid1
|
||||
@ -4039,16 +4050,20 @@ PFL();
|
||||
segtype_is_linear(new_segtype))
|
||||
goto err;
|
||||
|
||||
if (!seg->stripe_size)
|
||||
seg->stripe_size = new_stripe_size ?: DEFAULT_STRIPESIZE;
|
||||
|
||||
if (convert) {
|
||||
if ((segtype_is_raid0(new_segtype) || segtype_is_raid1(new_segtype)) && new_stripes) {
|
||||
log_error("--stripes N incompatible with raid0/1");
|
||||
return 0;
|
||||
}
|
||||
|
||||
PFLA("linear/raid1/4/5 new_image_count=%u", new_image_count);
|
||||
PFLA("linear/raid1/4/5 new_image_count=%u stripe_size=%u", new_image_count, seg->stripe_size);
|
||||
return _lv_raid_change_image_count(lv, new_segtype, new_image_count, allocate_pvs);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Mirror -> RAID1 conversion
|
||||
*/
|
||||
|
@ -167,7 +167,6 @@ int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
|
||||
#define SEG_TYPE_NAME_RAID10 "raid10"
|
||||
#define SEG_TYPE_NAME_RAID4 "raid4"
|
||||
#define SEG_TYPE_NAME_RAID5 "raid5"
|
||||
#define SEG_TYPE_NAME_RAID5_0 "raid5_0"
|
||||
#define SEG_TYPE_NAME_RAID5_N "raid5_n"
|
||||
#define SEG_TYPE_NAME_RAID5_LA "raid5_la"
|
||||
#define SEG_TYPE_NAME_RAID5_LS "raid5_ls"
|
||||
@ -181,7 +180,6 @@ int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
|
||||
#define SEG_TYPE_NAME_RAID6_LS_6 "raid6_ls_6"
|
||||
#define SEG_TYPE_NAME_RAID6_RA_6 "raid6_ra_6"
|
||||
#define SEG_TYPE_NAME_RAID6_RS_6 "raid6_rs_6"
|
||||
#define SEG_TYPE_NAME_RAID6_0_6 "raid6_0_6"
|
||||
#define SEG_TYPE_NAME_RAID6_N_6 "raid6_n_6"
|
||||
|
||||
#define segtype_is_raid0(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID0))
|
||||
@ -197,14 +195,12 @@ int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
|
||||
#define segtype_is_raid5_rs(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID5_RS))
|
||||
#define segtype_is_raid5_la(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID5_LA))
|
||||
#define segtype_is_raid5_ra(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID5_RA))
|
||||
#define segtype_is_raid5_0(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID5_0))
|
||||
#define segtype_is_raid5_n(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID5_N))
|
||||
#define segtype_is_any_raid6(segtype) (!strncmp((segtype)->name, SEG_TYPE_NAME_RAID6, 5))
|
||||
#define segtype_is_raid6_ls_6(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID6_LS_6))
|
||||
#define segtype_is_raid6_rs_6(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID6_RS_6))
|
||||
#define segtype_is_raid6_la_6(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID6_LA_6))
|
||||
#define segtype_is_raid6_ra_6(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID6_RA_6))
|
||||
#define segtype_is_raid6_0_6(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID6_0_6))
|
||||
#define segtype_is_raid6_n_6(segtype) (!strcmp((segtype)->name, SEG_TYPE_NAME_RAID6_N_6))
|
||||
#define segtype_is_striped_raid(segtype) (segtype_is_raid(segtype) && !segtype_is_raid1(segtype))
|
||||
|
||||
@ -227,7 +223,6 @@ int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib);
|
||||
#define seg_is_raid6_rs_6(seg) segtype_is_raid6_rs_6((seg)->segtype)
|
||||
#define seg_is_raid6_la_6(seg) segtype_is_raid6_la_6((seg)->segtype)
|
||||
#define seg_is_raid6_ra_6(seg) segtype_is_raid6_ra_6((seg)->segtype)
|
||||
#define seg_is_raid6_0_6(seg) segtype_is_raid6_0_6((seg)->segtype)
|
||||
#define seg_is_raid6_n_6(seg) segtype_is_raid6_n_6((seg)->segtype)
|
||||
#define seg_is_striped_raid(seg) segtype_is_striped_raid((seg)->segtype)
|
||||
|
||||
|
@ -496,7 +496,6 @@ static const struct raid_type {
|
||||
{ SEG_TYPE_NAME_RAID10, 0, SEG_AREAS_MIRRORED },
|
||||
{ SEG_TYPE_NAME_RAID4, 1 },
|
||||
{ SEG_TYPE_NAME_RAID5, 1 },
|
||||
{ SEG_TYPE_NAME_RAID5_0, 1 },
|
||||
{ SEG_TYPE_NAME_RAID5_N, 1 },
|
||||
{ SEG_TYPE_NAME_RAID5_LA, 1 },
|
||||
{ SEG_TYPE_NAME_RAID5_LS, 1 },
|
||||
@ -510,7 +509,6 @@ static const struct raid_type {
|
||||
{ SEG_TYPE_NAME_RAID6_LS_6, 2 },
|
||||
{ SEG_TYPE_NAME_RAID6_RA_6, 2 },
|
||||
{ SEG_TYPE_NAME_RAID6_RS_6, 2 },
|
||||
{ SEG_TYPE_NAME_RAID6_0_6, 2 },
|
||||
{ SEG_TYPE_NAME_RAID6_N_6, 2 },
|
||||
};
|
||||
|
||||
|
@ -55,7 +55,6 @@ enum {
|
||||
SEG_RAID1,
|
||||
SEG_RAID10,
|
||||
SEG_RAID4,
|
||||
SEG_RAID5_0,
|
||||
SEG_RAID5_N,
|
||||
SEG_RAID5_LA,
|
||||
SEG_RAID5_RA,
|
||||
@ -68,7 +67,6 @@ enum {
|
||||
SEG_RAID6_RA_6,
|
||||
SEG_RAID6_LS_6,
|
||||
SEG_RAID6_RS_6,
|
||||
SEG_RAID6_0_6,
|
||||
SEG_RAID6_N_6,
|
||||
};
|
||||
|
||||
@ -97,7 +95,6 @@ static const struct {
|
||||
{ SEG_RAID1, "raid1"},
|
||||
{ SEG_RAID10, "raid10"},
|
||||
{ SEG_RAID4, "raid4"},
|
||||
{ SEG_RAID5_0, "raid5_0"},
|
||||
{ SEG_RAID5_N, "raid5_n"},
|
||||
{ SEG_RAID5_LA, "raid5_la"},
|
||||
{ SEG_RAID5_RA, "raid5_ra"},
|
||||
@ -110,7 +107,6 @@ static const struct {
|
||||
{ SEG_RAID6_RA_6, "raid6_ra_6"},
|
||||
{ SEG_RAID6_LS_6, "raid6_ls_6"},
|
||||
{ SEG_RAID6_RS_6, "raid6_rs_6"},
|
||||
{ SEG_RAID6_0_6, "raid6_0_6"},
|
||||
{ SEG_RAID6_N_6, "raid6_n_6"},
|
||||
|
||||
/*
|
||||
@ -2123,7 +2119,6 @@ static int _emit_areas_line(struct dm_task *dmt __attribute__((unused)),
|
||||
case SEG_RAID1:
|
||||
case SEG_RAID10:
|
||||
case SEG_RAID4:
|
||||
case SEG_RAID5_0:
|
||||
case SEG_RAID5_N:
|
||||
case SEG_RAID5_LA:
|
||||
case SEG_RAID5_RA:
|
||||
@ -2136,7 +2131,6 @@ static int _emit_areas_line(struct dm_task *dmt __attribute__((unused)),
|
||||
case SEG_RAID6_RA_6:
|
||||
case SEG_RAID6_LS_6:
|
||||
case SEG_RAID6_RS_6:
|
||||
case SEG_RAID6_0_6:
|
||||
case SEG_RAID6_N_6:
|
||||
if (!area->dev_node) {
|
||||
EMIT_PARAMS(*pos, " -");
|
||||
@ -2601,7 +2595,6 @@ static int _emit_segment_line(struct dm_task *dmt, uint32_t major,
|
||||
case SEG_RAID1:
|
||||
case SEG_RAID10:
|
||||
case SEG_RAID4:
|
||||
case SEG_RAID5_0:
|
||||
case SEG_RAID5_N:
|
||||
case SEG_RAID5_LA:
|
||||
case SEG_RAID5_RA:
|
||||
@ -2614,7 +2607,6 @@ static int _emit_segment_line(struct dm_task *dmt, uint32_t major,
|
||||
case SEG_RAID6_RA_6:
|
||||
case SEG_RAID6_LS_6:
|
||||
case SEG_RAID6_RS_6:
|
||||
case SEG_RAID6_0_6:
|
||||
case SEG_RAID6_N_6:
|
||||
PFL();
|
||||
target_type_is_raid = 1;
|
||||
@ -4179,7 +4171,6 @@ int dm_tree_node_add_null_area(struct dm_tree_node *node, uint64_t offset)
|
||||
case SEG_RAID0_META:
|
||||
case SEG_RAID1:
|
||||
case SEG_RAID4:
|
||||
case SEG_RAID5_0:
|
||||
case SEG_RAID5_N:
|
||||
case SEG_RAID5_LA:
|
||||
case SEG_RAID5_RA:
|
||||
@ -4192,7 +4183,6 @@ int dm_tree_node_add_null_area(struct dm_tree_node *node, uint64_t offset)
|
||||
case SEG_RAID6_RA_6:
|
||||
case SEG_RAID6_LS_6:
|
||||
case SEG_RAID6_RS_6:
|
||||
case SEG_RAID6_0_6:
|
||||
case SEG_RAID6_N_6:
|
||||
break;
|
||||
default:
|
||||
|
@ -1929,7 +1929,9 @@ PFLA("stripes_ARG=%u stripes_long_ARG=%u", arg_count(lv->vg->cmd, stripes_ARG),
|
||||
if (arg_count(cmd, mirrors_ARG) &&
|
||||
!seg_is_linear(seg) &&
|
||||
!seg_is_mirrored(seg) &&
|
||||
!(seg_is_any_raid0(seg) && seg->area_count == 1)) {
|
||||
!(seg_is_any_raid0(seg) && seg->area_count == 1) &&
|
||||
!(seg_is_any_raid4(seg) && seg->area_count == 2) &&
|
||||
!(seg_is_any_raid5(seg) && seg->area_count == 2)) {
|
||||
log_error("'--mirrors/-m' is not compatible with %s",
|
||||
lvseg_name(seg));
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user