Blame SOURCES/Manage-Manage-ro-Use-md_array_active.patch

2c1b57
From 80223cb4db3358a24c41a76414a3804c26d5ea3a Mon Sep 17 00:00:00 2001
2c1b57
From: Jes Sorensen <jsorensen@fb.com>
2c1b57
Date: Tue, 2 May 2017 10:40:07 -0400
2c1b57
Subject: [RHEL7.5 PATCH 102/169] Manage: Manage_ro(): Use
2c1b57
 md_array_active()
2c1b57
2c1b57
One call less to md_get_array_info() for determining whether an array
2c1b57
is active or not.
2c1b57
2c1b57
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2c1b57
---
2c1b57
 Manage.c | 6 ++----
2c1b57
 1 file changed, 2 insertions(+), 4 deletions(-)
2c1b57
2c1b57
diff --git a/Manage.c b/Manage.c
2c1b57
index 8966e33..230309b 100644
2c1b57
--- a/Manage.c
2c1b57
+++ b/Manage.c
2c1b57
@@ -40,7 +40,6 @@ int Manage_ro(char *devname, int fd, int readonly)
2c1b57
 	 * use RESTART_ARRAY_RW or STOP_ARRAY_RO
2c1b57
 	 *
2c1b57
 	 */
2c1b57
-	mdu_array_info_t array;
2c1b57
 	struct mdinfo *mdi;
2c1b57
 	int rv = 0;
2c1b57
 
2c1b57
@@ -88,9 +87,8 @@ int Manage_ro(char *devname, int fd, int readonly)
2c1b57
 		goto out;
2c1b57
 	}
2c1b57
 
2c1b57
-	if (md_get_array_info(fd, &array)) {
2c1b57
-		pr_err("%s does not appear to be active.\n",
2c1b57
-			devname);
2c1b57
+	if (!md_array_active(fd)) {
2c1b57
+		pr_err("%s does not appear to be active.\n", devname);
2c1b57
 		rv = 1;
2c1b57
 		goto out;
2c1b57
 	}
2c1b57
-- 
2c1b57
2.7.4
2c1b57