From e4965ef8461b3d0db6e94939f07d814d819f86c2 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 13 Oct 2008 16:15:18 +1100 Subject: 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). --- super1.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'super1.c') diff --git a/super1.c b/super1.c index e1d02190..bec0c5e4 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: -- cgit v1.2.3