]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
imsm: Add information about migration record to mdadm '-E' option
authorAdam Kwolek <adam.kwolek@intel.com>
Wed, 8 Jun 2011 07:09:29 +0000 (17:09 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 8 Jun 2011 07:09:29 +0000 (17:09 +1000)
Add ability to display information from migration record in examine
option.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
super-intel.c

index 69cab38c8f47f24ae2640aef2809428bda7b4609..b21058b0ff262d015109a4c437227d39006ca766 100644 (file)
@@ -1035,6 +1035,57 @@ static void print_imsm_disk(struct imsm_super *mpb, int index, __u32 reserved)
               human_size(sz * 512));
 }
 
+static int is_gen_migration(struct imsm_dev *dev);
+
+void examine_migr_rec_imsm(struct intel_super *super)
+{
+       struct migr_record *migr_rec = super->migr_rec;
+       struct imsm_super *mpb = super->anchor;
+       int i;
+
+       for (i = 0; i < mpb->num_raid_devs; i++) {
+               struct imsm_dev *dev = __get_imsm_dev(mpb, i);
+               if (is_gen_migration(dev) == 0)
+                               continue;
+
+               printf("\nMigration Record Information:");
+               if (super->disks->index > 1) {
+                       printf(" Empty\n                              ");
+                       printf("Examine one of first two disks in array\n");
+                       break;
+               }
+               printf("\n                     Status : ");
+               if (__le32_to_cpu(migr_rec->rec_status) == UNIT_SRC_NORMAL)
+                       printf("Normal\n");
+               else
+                       printf("Contains Data\n");
+               printf("               Current Unit : %u\n",
+                      __le32_to_cpu(migr_rec->curr_migr_unit));
+               printf("                     Family : %u\n",
+                      __le32_to_cpu(migr_rec->family_num));
+               printf("                  Ascending : %u\n",
+                      __le32_to_cpu(migr_rec->ascending_migr));
+               printf("            Blocks Per Unit : %u\n",
+                      __le32_to_cpu(migr_rec->blocks_per_unit));
+               printf("       Dest. Depth Per Unit : %u\n",
+                      __le32_to_cpu(migr_rec->dest_depth_per_unit));
+               printf("        Checkpoint Area pba : %u\n",
+                      __le32_to_cpu(migr_rec->ckpt_area_pba));
+               printf("           First member lba : %u\n",
+                      __le32_to_cpu(migr_rec->dest_1st_member_lba));
+               printf("      Total Number of Units : %u\n",
+                      __le32_to_cpu(migr_rec->num_migr_units));
+               printf("             Size of volume : %u\n",
+                      __le32_to_cpu(migr_rec->post_migr_vol_cap));
+               printf("  Expansion space for LBA64 : %u\n",
+                      __le32_to_cpu(migr_rec->post_migr_vol_cap_hi));
+               printf("       Record was read from : %u\n",
+                      __le32_to_cpu(migr_rec->ckpt_read_disk_num));
+
+               break;
+       }
+}
+
 static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info, char *map);
 
 static void examine_super_imsm(struct supertype *st, char *homehost)
@@ -1112,6 +1163,8 @@ static void examine_super_imsm(struct supertype *st, char *homehost)
                printf("    Usable Size : %llu%s\n", (unsigned long long)sz,
                       human_size(sz * 512));
        }
+
+       examine_migr_rec_imsm(super);
 }
 
 static void brief_examine_super_imsm(struct supertype *st, int verbose)