]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Manage: Manage_ro(): Use md_array_active()
authorJes Sorensen <jsorensen@fb.com>
Tue, 2 May 2017 14:40:07 +0000 (10:40 -0400)
committerJes Sorensen <jsorensen@fb.com>
Tue, 2 May 2017 14:41:23 +0000 (10:41 -0400)
One call less to md_get_array_info() for determining whether an array
is active or not.

Signed-off-by: Jes Sorensen <jsorensen@fb.com>
Manage.c

index 8966e3368d1e3c7b47de9d6a19e93b5aadf46351..230309b8a7200e10dd2b1b301c429597c9feff92 100644 (file)
--- a/Manage.c
+++ b/Manage.c
@@ -40,7 +40,6 @@ int Manage_ro(char *devname, int fd, int readonly)
         * use RESTART_ARRAY_RW or STOP_ARRAY_RO
         *
         */
-       mdu_array_info_t array;
        struct mdinfo *mdi;
        int rv = 0;
 
@@ -88,9 +87,8 @@ int Manage_ro(char *devname, int fd, int readonly)
                goto out;
        }
 
-       if (md_get_array_info(fd, &array)) {
-               pr_err("%s does not appear to be active.\n",
-                       devname);
+       if (!md_array_active(fd)) {
+               pr_err("%s does not appear to be active.\n", devname);
                rv = 1;
                goto out;
        }