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 <jsorensen@fb.com>
This commit is contained in:
Jes Sorensen 2017-05-02 10:40:07 -04:00
parent 6921010d95
commit 80223cb4db
1 changed files with 2 additions and 4 deletions

View File

@ -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;
}