]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - util.c
Assemble/super0: allow non-in-sync devices to be assembled without complaint.
[thirdparty/mdadm.git] / util.c
diff --git a/util.c b/util.c
index f646bb9284bf16516d3841386298b85e1dda5482..048c39f6c69b1d7de7dffb4a5c07edd575350e2f 100644 (file)
--- a/util.c
+++ b/util.c
@@ -149,6 +149,7 @@ int get_linux_version()
        return (a*1000000)+(b*1000)+c;
 }
 
+#ifndef MDASSEMBLE
 long long parse_size(char *size)
 {
        /* parse 'size' which should be a number optionally
@@ -213,6 +214,7 @@ int parse_layout_faulty(char *layout)
 
        return mode | (atoi(layout+ln)<< ModeShift);
 }
+#endif
 
 void remove_partitions(int fd)
 {
@@ -334,17 +336,15 @@ void copy_uuid(void *a, int b[4], int swapuuid)
                memcpy(a, b, 16);
 }
 
-char *fname_from_uuid(struct supertype *st, struct mdinfo *info, char *buf, char sep)
+char *__fname_from_uuid(int id[4], int swap, char *buf, char sep)
 {
        int i, j;
-       int id;
        char uuid[16];
        char *c = buf;
        strcpy(c, "UUID-");
        c += strlen(c);
-       copy_uuid(uuid, info->uuid, st->ss->swapuuid);
+       copy_uuid(uuid, id, swap);
        for (i = 0; i < 4; i++) {
-               id = uuid[i];
                if (i)
                        *c++ = sep;
                for (j = 3; j >= 0; j--) {
@@ -353,6 +353,12 @@ char *fname_from_uuid(struct supertype *st, struct mdinfo *info, char *buf, char
                }
        }
        return buf;
+
+}
+
+char *fname_from_uuid(struct supertype *st, struct mdinfo *info, char *buf, char sep)
+{
+       return __fname_from_uuid(info->uuid, st->ss->swapuuid, buf, sep);
 }
 
 #ifndef MDASSEMBLE