From: Jes Sorensen Date: Tue, 2 May 2017 14:40:07 +0000 (-0400) Subject: Manage: Manage_ro(): Use md_array_active() X-Git-Tag: mdadm-4.1-rc1~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80223cb4db3358a24c41a76414a3804c26d5ea3a;p=thirdparty%2Fmdadm.git Manage: Manage_ro(): Use md_array_active() One call less to md_get_array_info() for determining whether an array is active or not. Signed-off-by: Jes Sorensen --- diff --git a/Manage.c b/Manage.c index 8966e336..230309b8 100644 --- 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; }