]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - util.c
util: Introduce md_set_array_info()
[thirdparty/mdadm.git] / util.c
diff --git a/util.c b/util.c
index aa27e59de7b8807c0664e04b829f6bb47a21e0f0..9fc7ba03c2349fbf18371df6887e84d5d980ecec 100644 (file)
--- a/util.c
+++ b/util.c
@@ -220,6 +220,14 @@ int md_get_array_info(int fd, struct mdu_array_info_s *array)
        return ioctl(fd, GET_ARRAY_INFO, array);
 }
 
+/*
+ * Set array info
+ */
+int md_set_array_info(int fd, struct mdu_array_info_s *array)
+{
+       return ioctl(fd, SET_ARRAY_INFO, array);
+}
+
 /*
  * Get disk info from the kernel.
  */
@@ -1858,9 +1866,9 @@ int set_array_info(int mdfd, struct supertype *st, struct mdinfo *info)
                memset(&inf, 0, sizeof(inf));
                inf.major_version = info->array.major_version;
                inf.minor_version = info->array.minor_version;
-               rv = ioctl(mdfd, SET_ARRAY_INFO, &inf);
+               rv = md_set_array_info(mdfd, &inf);
        } else
-               rv = ioctl(mdfd, SET_ARRAY_INFO, NULL);
+               rv = md_set_array_info(mdfd, NULL);
        return rv;
 }