summaryrefslogtreecommitdiffstats
path: root/Manage.c
diff options
context:
space:
mode:
authorJes Sorensen <jsorensen@fb.com>2017-05-02 16:40:07 +0200
committerJes Sorensen <jsorensen@fb.com>2017-05-02 16:41:23 +0200
commit80223cb4db3358a24c41a76414a3804c26d5ea3a (patch)
tree56c2691b3593d89c0c303793c4eddda6249e13ba /Manage.c
parentIncremental: Use md_array_active() to determine state of array (diff)
downloadmdadm-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.c6
1 files changed, 2 insertions, 4 deletions
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;
}