summaryrefslogtreecommitdiffstats
path: root/super1.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-10-13 16:15:18 +1100
committerNeilBrown <neilb@suse.de>2008-10-13 16:15:18 +1100
commite4965ef8461b3d0db6e94939f07d814d819f86c2 (patch)
tree61e614fb47f97eb10e6628fa531a0065b4ddf0c4 /super1.c
parent2a528478c75b6659188fc2ce0d9543124992fe6c (diff)
downloadmdadm-e4965ef8461b3d0db6e94939f07d814d819f86c2.tar.gz
mdadm-e4965ef8461b3d0db6e94939f07d814d819f86c2.tar.xz
mdadm-e4965ef8461b3d0db6e94939f07d814d819f86c2.zip
Improve reporting of layout for raid10.
Showing e.g. near=1, far=2 for the 'far2' layout of raid10 is confusing even though there is a sense in which is it correct. Make it less confusing by only printing whichever number is not 1. If both are 1, make that clear too (i.e. no redundancy).
Diffstat (limited to 'super1.c')
-rw-r--r--super1.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/super1.c b/super1.c
index e1d0219..bec0c5e 100644
--- a/super1.c
+++ b/super1.c
@@ -248,10 +248,9 @@ static void examine_super1(struct supertype *st, char *homehost)
printf(" New Layout : %s\n", c?c:"-unknown-");
}
if (__le32_to_cpu(sb->level) == 10) {
- printf(" New Layout : near=%d, %s=%d\n",
- __le32_to_cpu(sb->new_layout)&255,
- (__le32_to_cpu(sb->new_layout)&0x10000)?"offset":"far",
- (__le32_to_cpu(sb->new_layout)>>8)&255);
+ printf(" New Layout :");
+ print_r10_layout(__le32_to_cpu(sb->new_layout));
+ printf("\n");
}
}
if (__le32_to_cpu(sb->new_chunk) != __le32_to_cpu(sb->chunksize))
@@ -281,10 +280,9 @@ static void examine_super1(struct supertype *st, char *homehost)
}
if (__le32_to_cpu(sb->level) == 10) {
int lo = __le32_to_cpu(sb->layout);
- printf(" Layout : near=%d, %s=%d\n",
- lo&255,
- (lo&0x10000)?"offset":"far",
- (lo>>8)&255);
+ printf(" Layout :");
+ print_r10_layout(lo);
+ printf("\n");
}
switch(__le32_to_cpu(sb->level)) {
case 0: