]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - util.c
Replace all relevant occurrences of -4 with LEVEL_MULTIPATH
[thirdparty/mdadm.git] / util.c
diff --git a/util.c b/util.c
index 662061b0b29fd61dcf7e5b3041e3d4a8c7a33938..a0e4bcf0aac94e46c9995523ebead1b06a2b7131 100644 (file)
--- a/util.c
+++ b/util.c
@@ -261,9 +261,9 @@ int enough(int level, int raid_disks, int layout, int clean,
                } while (first != 0);
                return 1;
 
                } while (first != 0);
                return 1;
 
-       case -4:
+       case LEVEL_MULTIPATH:
                return avail_disks>= 1;
                return avail_disks>= 1;
-       case -1:
+       case LEVEL_LINEAR:
        case 0:
                return avail_disks == raid_disks;
        case 1:
        case 0:
                return avail_disks == raid_disks;
        case 1:
@@ -336,17 +336,15 @@ void copy_uuid(void *a, int b[4], int swapuuid)
                memcpy(a, b, 16);
 }
 
                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 i, j;
-       int id;
        char uuid[16];
        char *c = buf;
        strcpy(c, "UUID-");
        c += strlen(c);
        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++) {
        for (i = 0; i < 4; i++) {
-               id = uuid[i];
                if (i)
                        *c++ = sep;
                for (j = 3; j >= 0; j--) {
                if (i)
                        *c++ = sep;
                for (j = 3; j >= 0; j--) {
@@ -355,6 +353,12 @@ char *fname_from_uuid(struct supertype *st, struct mdinfo *info, char *buf, char
                }
        }
        return buf;
                }
        }
        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
 }
 
 #ifndef MDASSEMBLE