]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - super0.c
Add --export option to --detail to use key=value pairs.
[thirdparty/mdadm.git] / super0.c
index 757d9056672b2f1110acbdae5ea2d08da19fde73..5828e15b302fb9e5ee3d0bd608a3053b782fd036 100644 (file)
--- a/super0.c
+++ b/super0.c
@@ -110,6 +110,9 @@ static void examine_super0(void *sbv, char *homehost)
        } else
                printf("           UUID : %08x\n", sb->set_uuid0);
 
+       if (sb->not_persistent)
+               printf("           Eedk : not persistent\n");
+
        atime = sb->ctime;
        printf("  Creation Time : %.24s\n", ctime(&atime));
        c=map_num(pers, sb->level);
@@ -277,6 +280,18 @@ static void brief_detail_super0(void *sbv)
        else
                printf("%08x", sb->set_uuid0);
 }
+
+static void export_super0(void *sbv)
+{
+       mdp_super_t *sb = sbv;
+       printf("MD_UUID=");
+       if (sb->minor_version >= 90)
+               printf("%08x:%08x:%08x:%08x", sb->set_uuid0, sb->set_uuid1,
+                      sb->set_uuid2, sb->set_uuid3);
+       else
+               printf("%08x", sb->set_uuid0);
+       printf("\n");
+}
 #endif
 
 static int match_home0(void *sbv, char *homehost)
@@ -700,7 +715,6 @@ static int load_super0(struct supertype *st, int fd, void **sbp, char *devname)
         *  1 on cannot get superblock
         *  2 on superblock meaningless
         */
-       unsigned long size;
        unsigned long long dsize;
        unsigned long long offset;
        mdp_super_t *super;
@@ -712,8 +726,9 @@ static int load_super0(struct supertype *st, int fd, void **sbp, char *devname)
 
        if (dsize < MD_RESERVED_SECTORS*512 * 2) {
                if (devname)
-                       fprintf(stderr, Name ": %s is too small for md: size is %ld sectors.\n",
-                               devname, size);
+                       fprintf(stderr, Name
+                           ": %s is too small for md: size is %llu sectors.\n",
+                               devname, dsize);
                return 1;
        }
 
@@ -937,6 +952,7 @@ struct superswitch super0 = {
        .brief_examine_super = brief_examine_super0,
        .detail_super = detail_super0,
        .brief_detail_super = brief_detail_super0,
+       .export_super = export_super0,
 #endif
        .match_home = match_home0,
        .uuid_from_super = uuid_from_super0,