1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

const: raid takover arrays

This commit is contained in:
Zdenek Kabelac 2024-05-03 11:35:38 +02:00
parent 6430a6ca63
commit 9f506eb89e
2 changed files with 9 additions and 9 deletions

View File

@ -4517,7 +4517,7 @@ struct possible_type {
const uint32_t options;
};
static struct possible_takeover_reshape_type _possible_takeover_reshape_types[] = {
static const struct possible_takeover_reshape_type _possible_takeover_reshape_types[] = {
/* striped -> raid1 */
{ .current_types = SEG_STRIPED_TARGET, /* linear, i.e. seg->area_count = 1 */
.possible_types = SEG_RAID1,
@ -4629,12 +4629,12 @@ static struct possible_takeover_reshape_type _possible_takeover_reshape_types[]
/*
* Return possible_type struct for current segment type.
*/
static struct possible_takeover_reshape_type *_get_possible_takeover_reshape_type(const struct lv_segment *seg_from,
const struct segment_type *segtype_to,
struct possible_type *last_pt)
static const struct possible_takeover_reshape_type *_get_possible_takeover_reshape_type(const struct lv_segment *seg_from,
const struct segment_type *segtype_to,
const struct possible_type *last_pt)
{
struct possible_takeover_reshape_type *lpt = (struct possible_takeover_reshape_type *) last_pt;
struct possible_takeover_reshape_type *pt = lpt ? lpt + 1 : _possible_takeover_reshape_types;
const struct possible_takeover_reshape_type *lpt = (const struct possible_takeover_reshape_type *) last_pt;
const struct possible_takeover_reshape_type *pt = lpt ? lpt + 1 : _possible_takeover_reshape_types;
for ( ; pt->current_types; pt++)
if ((seg_from->segtype->flags & pt->current_types) &&
@ -6066,7 +6066,7 @@ static int _log_prohibited_option(const struct lv_segment *seg_from,
* Find takeover raid flag for segment type flag of @seg
*/
/* Segment type flag correspondence for raid5 <-> raid6 conversions */
static uint64_t _r5_to_r6[][2] = {
static const uint64_t _r5_to_r6[][2] = {
{ SEG_RAID5_LS, SEG_RAID6_LS_6 },
{ SEG_RAID5_LA, SEG_RAID6_LA_6 },
{ SEG_RAID5_RS, SEG_RAID6_RS_6 },

View File

@ -79,7 +79,7 @@
#define str_r45 _takeover_from_striped_to_raid45
#define str_r6 _takeover_from_striped_to_raid6
static uint64_t _segtype_index[] = {
static const uint64_t _segtype_index[] = {
1, /* linear */
1, /* striped */
SEG_MIRROR,
@ -100,7 +100,7 @@ static uint64_t _segtype_index[] = {
* N represents a combination that has no effect (no-op).
* X represents a combination that is unsupported.
*/
static takeover_fn_t _takeover_fns[][11] = {
static const takeover_fn_t _takeover_fns[][11] = {
/* from, to -> linear striped mirror raid0 raid0_meta raid1 raid4/5 raid6 raid10 raid01 other*/
/* | */
/* v */