super1/examine: remove confusing information.
The information about how slots and roles in the array lined up turned out to be confusing. So simplify it and one provide the interesting information. Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
5ea022a16e
commit
e8e1c176d8
25
super1.c
25
super1.c
|
@ -205,7 +205,7 @@ static void examine_super1(struct supertype *st, char *homehost)
|
||||||
struct mdp_superblock_1 *sb = st->sb;
|
struct mdp_superblock_1 *sb = st->sb;
|
||||||
time_t atime;
|
time_t atime;
|
||||||
int d;
|
int d;
|
||||||
int faulty;
|
int role;
|
||||||
int i;
|
int i;
|
||||||
char *c;
|
char *c;
|
||||||
int l = homehost ? strlen(homehost) : 0;
|
int l = homehost ? strlen(homehost) : 0;
|
||||||
|
@ -356,6 +356,8 @@ static void examine_super1(struct supertype *st, char *homehost)
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
#if 0
|
||||||
|
/* This turns out to just be confusing */
|
||||||
printf(" Array Slot : %d (", __le32_to_cpu(sb->dev_number));
|
printf(" Array Slot : %d (", __le32_to_cpu(sb->dev_number));
|
||||||
for (i= __le32_to_cpu(sb->max_dev); i> 0 ; i--)
|
for (i= __le32_to_cpu(sb->max_dev); i> 0 ; i--)
|
||||||
if (__le16_to_cpu(sb->dev_roles[i-1]) != 0xffff)
|
if (__le16_to_cpu(sb->dev_roles[i-1]) != 0xffff)
|
||||||
|
@ -368,6 +370,18 @@ static void examine_super1(struct supertype *st, char *homehost)
|
||||||
else printf("%d", role);
|
else printf("%d", role);
|
||||||
}
|
}
|
||||||
printf(")\n");
|
printf(")\n");
|
||||||
|
#endif
|
||||||
|
printf(" Device Role : ");
|
||||||
|
d = __le32_to_cpu(sb->dev_number);
|
||||||
|
if (d < sb->raid_disks)
|
||||||
|
role = __le16_to_cpu(sb->dev_roles[d]);
|
||||||
|
else
|
||||||
|
role = 0xFFFF;
|
||||||
|
if (role >= 0xFFFE)
|
||||||
|
printf("spare\n");
|
||||||
|
else
|
||||||
|
printf("Active device %d\n", role);
|
||||||
|
|
||||||
printf(" Array State : ");
|
printf(" Array State : ");
|
||||||
for (d=0; d<__le32_to_cpu(sb->raid_disks); d++) {
|
for (d=0; d<__le32_to_cpu(sb->raid_disks); d++) {
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
|
@ -382,10 +396,11 @@ static void examine_super1(struct supertype *st, char *homehost)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cnt > 1) printf("?");
|
if (cnt > 1) printf("?");
|
||||||
else if (cnt == 1 && me) printf("U");
|
else if (cnt == 1) printf("A");
|
||||||
else if (cnt == 1) printf("u");
|
else printf (".");
|
||||||
else printf ("_");
|
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
|
/* This is confusing too */
|
||||||
faulty = 0;
|
faulty = 0;
|
||||||
for (i=0; i< __le32_to_cpu(sb->max_dev); i++) {
|
for (i=0; i< __le32_to_cpu(sb->max_dev); i++) {
|
||||||
int role = __le16_to_cpu(sb->dev_roles[i]);
|
int role = __le16_to_cpu(sb->dev_roles[i]);
|
||||||
|
@ -393,6 +408,8 @@ static void examine_super1(struct supertype *st, char *homehost)
|
||||||
faulty++;
|
faulty++;
|
||||||
}
|
}
|
||||||
if (faulty) printf(" %d failed", faulty);
|
if (faulty) printf(" %d failed", faulty);
|
||||||
|
#endif
|
||||||
|
printf(" ('A' == active, '.' == missing)");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue