diff options
author | Jes Sorensen <jsorensen@fb.com> | 2017-05-02 16:40:07 +0200 |
---|---|---|
committer | Jes Sorensen <jsorensen@fb.com> | 2017-05-02 16:41:23 +0200 |
commit | 80223cb4db3358a24c41a76414a3804c26d5ea3a (patch) | |
tree | 56c2691b3593d89c0c303793c4eddda6249e13ba /Manage.c | |
parent | Incremental: Use md_array_active() to determine state of array (diff) | |
download | mdadm-80223cb4db3358a24c41a76414a3804c26d5ea3a.tar.xz mdadm-80223cb4db3358a24c41a76414a3804c26d5ea3a.zip |
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>
Diffstat (limited to 'Manage.c')
-rw-r--r-- | Manage.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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; } |