multipathd: move set_no_path_retry() back to libmultipath
authorMartin Wilck <mwilck@suse.com>
Fri, 15 Nov 2019 14:41:46 +0000 (14:41 +0000)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Mon, 2 Mar 2020 23:31:11 +0000 (00:31 +0100)
This function is useful elsewhere, too. No code changes except
for changing the linkage.

Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/structs_vec.c
libmultipath/structs_vec.h
multipathd/main.c

index 6991f9a..fbe9766 100644 (file)
@@ -308,6 +308,36 @@ void enter_recovery_mode(struct multipath *mpp)
                mpp->alias, mpp->no_path_retry);
 }
 
+void set_no_path_retry(struct multipath *mpp)
+{
+       char is_queueing = 0;
+
+       mpp->nr_active = pathcount(mpp, PATH_UP) + pathcount(mpp, PATH_GHOST);
+       if (mpp->features && strstr(mpp->features, "queue_if_no_path"))
+               is_queueing = 1;
+
+       switch (mpp->no_path_retry) {
+       case NO_PATH_RETRY_UNDEF:
+               break;
+       case NO_PATH_RETRY_FAIL:
+               if (is_queueing)
+                       dm_queue_if_no_path(mpp->alias, 0);
+               break;
+       case NO_PATH_RETRY_QUEUE:
+               if (!is_queueing)
+                       dm_queue_if_no_path(mpp->alias, 1);
+               break;
+       default:
+               if (mpp->nr_active > 0) {
+                       mpp->retry_tick = 0;
+                       if (!is_queueing)
+                               dm_queue_if_no_path(mpp->alias, 1);
+               } else if (is_queueing && mpp->retry_tick == 0)
+                       enter_recovery_mode(mpp);
+               break;
+       }
+}
+
 void
 sync_map_state(struct multipath *mpp)
 {
index f8b9f63..d321927 100644 (file)
@@ -11,6 +11,7 @@ struct vectors {
        vector mpvec;
 };
 
+void set_no_path_retry(struct multipath *mpp);
 void enter_recovery_mode(struct multipath *mpp);
 
 int adopt_paths (vector pathvec, struct multipath * mpp);
index e15ece0..dc07d34 100644 (file)
@@ -409,36 +409,6 @@ set_multipath_wwid (struct multipath * mpp)
        dm_get_uuid(mpp->alias, mpp->wwid, WWID_SIZE);
 }
 
-static void set_no_path_retry(struct multipath *mpp)
-{
-       char is_queueing = 0;
-
-       mpp->nr_active = pathcount(mpp, PATH_UP) + pathcount(mpp, PATH_GHOST);
-       if (mpp->features && strstr(mpp->features, "queue_if_no_path"))
-               is_queueing = 1;
-
-       switch (mpp->no_path_retry) {
-       case NO_PATH_RETRY_UNDEF:
-               break;
-       case NO_PATH_RETRY_FAIL:
-               if (is_queueing)
-                       dm_queue_if_no_path(mpp->alias, 0);
-               break;
-       case NO_PATH_RETRY_QUEUE:
-               if (!is_queueing)
-                       dm_queue_if_no_path(mpp->alias, 1);
-               break;
-       default:
-               if (mpp->nr_active > 0) {
-                       mpp->retry_tick = 0;
-                       if (!is_queueing)
-                               dm_queue_if_no_path(mpp->alias, 1);
-               } else if (is_queueing && mpp->retry_tick == 0)
-                       enter_recovery_mode(mpp);
-               break;
-       }
-}
-
 int __setup_multipath(struct vectors *vecs, struct multipath *mpp,
                      int reset)
 {