]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - util.c
A recent patch broke --create --level=faulty - fix it.
[thirdparty/mdadm.git] / util.c
diff --git a/util.c b/util.c
index c21bf5143dfd43129cadb04f9816288f83a5ef0e..f57613f533a993f4e72b9aeea6bbb52cc451eb8c 100644 (file)
--- a/util.c
+++ b/util.c
@@ -468,10 +468,6 @@ int nftw(const char *path, int (*han)(const char *name, const struct stat *stb,
        return ftw(path, add_dev_1, nopenfd);
 }
 #else
-int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s)
-{
-       return 0;
-}
 int nftw(const char *path, int (*han)(const char *name, const struct stat *stb, int flag, struct FTW *s), int nopenfd, int flags)
 {
        return 0;
@@ -815,6 +811,14 @@ int get_dev_size(int fd, char *dname, unsigned long long *sizep)
        return 1;
 }
 
+void get_one_disk(int mdfd, mdu_array_info_t *ainf, mdu_disk_info_t *disk)
+{
+       int d;
+       ioctl(mdfd, GET_ARRAY_INFO, ainf);
+       for (d = 0 ; d < ainf->raid_disks + ainf->nr_disks ; d++)
+               if (ioctl(mdfd, GET_DISK_INFO, disk) == 0)
+                       return;
+}
 #ifdef __TINYC__
 /* tinyc doesn't optimize this check in ioctl.h out ... */
 unsigned int __invalid_size_argument_for_IOC = 0;