]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Add 'Array Slot' line to --examine for version-1 superblocks
authorNeil Brown <neilb@suse.de>
Mon, 26 Jun 2006 02:26:01 +0000 (12:26 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 26 Jun 2006 02:26:01 +0000 (12:26 +1000)
to make it a bit easier to see what is happening.

ChangeLog
super1.c

index 4c45f550e3fb272b7361291570c6e166ec8bc0cf..c6b1a13bfbf18588c9822515ea9cd5e113f605ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@ Changes Prior to this release
     -   Fix problem with compiling with gcc-2 compilers
     -   Fix compile problem of post-incrmenting a variable in a macro arg.
     -   Stop map_dev from returning [0:0], as that breaks things.
+    -   Add 'Array Slot' line to --examine for version-1 superblocks
+       to make it a bit easier to see what is happening.
 
 Changes Prior to 2.5.1 release
     -   Various fixes for gcc warnings
index bcfe573567bceff5568243baea7ca93e2103b5c7..686215557adf71de8e353a37d3a7d7ed591114cf 100644 (file)
--- a/super1.c
+++ b/super1.c
@@ -277,6 +277,18 @@ static void examine_super1(void *sbv, char *homehost)
        default: break;
        }
        printf("\n");
+       printf("    Array Slot : %d (", __le32_to_cpu(sb->dev_number));
+       for (i= __le32_to_cpu(sb->max_dev); i> 0 ; i--)
+               if (__le16_to_cpu(sb->dev_roles[i-1]) != 0xffff)
+                       break;
+       for (d=0; d < i; d++) {
+               int role = __le16_to_cpu(sb->dev_roles[d]);
+               if (d) printf(", ");
+               if (role == 0xffff) printf("empty");
+               else if(role == 0xfffe) printf("failed");
+               else printf("%d", role);
+       }
+       printf(")\n");
        printf("   Array State : ");
        for (d=0; d<__le32_to_cpu(sb->raid_disks); d++) {
                int cnt = 0;