]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Build.c
mdadm-1.6.0
[thirdparty/mdadm.git] / Build.c
diff --git a/Build.c b/Build.c
index 51f2df07c3744389be1bde877ac061d63d2ba003..3e182f8c8b63d11e15541a442fb974c18e8a53a1 100644 (file)
--- a/Build.c
+++ b/Build.c
@@ -1,5 +1,5 @@
 /*
- * mdctl - manage Linux "md" devices aka RAID arrays.
+ * mdadm - manage Linux "md" devices aka RAID arrays.
  *
  * Copyright (C) 2001-2002 Neil Brown <neilb@cse.unsw.edu.au>
  *
@@ -27,7 +27,7 @@
  *           Australia
  */
 
-#include "mdctl.h"
+#include "mdadm.h"
 
 #define REGISTER_DEV           _IO (MD_MAJOR, 1)
 #define START_MD               _IO (MD_MAJOR, 2)
@@ -35,7 +35,7 @@
 
 int Build(char *mddev, int mdfd, int chunk, int level,
          int raiddisks,
-         mddev_dev_t devlist)
+         mddev_dev_t devlist, int assume_clean)
 {
        /* Build a linear or raid0 arrays without superblocks
         * We cannot really do any checks, we just do it.
@@ -91,6 +91,8 @@ int Build(char *mddev, int mdfd, int chunk, int level,
                        array.md_minor = MINOR(stb.st_rdev);
                array.not_persistent = 1;
                array.state = 0; /* not clean, but no errors */
+               if (assume_clean)
+                       array.state |= 1;
                array.active_disks = raiddisks;
                array.working_disks = raiddisks;
                array.spare_disks = 0;
@@ -130,7 +132,7 @@ int Build(char *mddev, int mdfd, int chunk, int level,
                        }
                } else {
                        if (ioctl(mdfd, REGISTER_DEV, &stb.st_rdev)) {
-                               fprintf(stderr, Name ": REGISTER_DEV failed for %s.\n",
+                               fprintf(stderr, Name ": REGISTER_DEV failed for %s: %s.\n",
                                        dv->devname, strerror(errno));
                                goto abort;
                        }