]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - Create.c
util: Introduce md_get_array_info()
[thirdparty/mdadm.git] / Create.c
index 10e7d108956d9ae5504458f258bd1e43cfec1662..0e0778ff5327054e7b86be98279ce3903ed871d9 100644 (file)
--- a/Create.c
+++ b/Create.c
@@ -156,8 +156,7 @@ int Create(struct supertype *st, char *mddev,
                memset(&inf, 0, sizeof(inf));
                fd = open(devlist->devname, O_RDONLY);
                if (fd >= 0 &&
-                   ioctl(fd, GET_ARRAY_INFO, &inf) == 0 &&
-                   inf.raid_disks == 0) {
+                   md_get_array_info(fd, &inf) == 0 && inf.raid_disks == 0) {
                        /* yep, looks like a container */
                        if (st) {
                                rv = st->ss->load_container(st, fd,
@@ -634,7 +633,7 @@ int Create(struct supertype *st, char *mddev,
        } else {
                mdu_array_info_t inf;
                memset(&inf, 0, sizeof(inf));
-               ioctl(mdfd, GET_ARRAY_INFO, &inf);
+               md_get_array_info(mdfd, &inf);
                if (inf.working_disks != 0) {
                        pr_err("another array by this name is already running.\n");
                        goto abort_locked;