* [PATCH v2 1/5] multipathd: move set_no_path_retry() back to libmultipath
[not found] <20191120125437.19372-1-martin.wilck@suse.com>
@ 2019-11-20 12:55 ` Martin Wilck
0 siblings, 0 replies; 2+ messages in thread
From: Martin Wilck @ 2019-11-20 12:55 UTC (permalink / raw)
To: Christophe Varoqui, Benjamin Marzinski
Cc: Bart Van Assche, Xose Vazquez Perez, dm-devel, Martin Wilck, Chongyun Wu
From: Martin Wilck <mwilck@suse.com>
This function is useful elsewhere, too. No code changes except
for changing the linkage.
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
libmultipath/structs_vec.c | 30 ++++++++++++++++++++++++++++++
libmultipath/structs_vec.h | 1 +
multipathd/main.c | 30 ------------------------------
3 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index 6991f9ac..fbe97662 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -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)
{
diff --git a/libmultipath/structs_vec.h b/libmultipath/structs_vec.h
index f8b9f63e..d3219278 100644
--- a/libmultipath/structs_vec.h
+++ b/libmultipath/structs_vec.h
@@ -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);
diff --git a/multipathd/main.c b/multipathd/main.c
index bb5c1f1d..a21d96e4 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -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)
{
--
2.24.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH v2 1/5] multipathd: move set_no_path_retry() back to libmultipath
2019-11-27 15:05 [PATCH v2 RESEND 0/5] Drop nr_active, and some more fixes Martin Wilck
@ 2019-11-27 15:05 ` Martin Wilck
0 siblings, 0 replies; 2+ messages in thread
From: Martin Wilck @ 2019-11-27 15:05 UTC (permalink / raw)
To: Christophe Varoqui, Benjamin Marzinski
Cc: Chongyun Wu, dm-devel, Xose Vazquez Perez, Martin Wilck
From: Martin Wilck <mwilck@suse.com>
This function is useful elsewhere, too. No code changes except
for changing the linkage.
Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
libmultipath/structs_vec.c | 30 ++++++++++++++++++++++++++++++
libmultipath/structs_vec.h | 1 +
multipathd/main.c | 30 ------------------------------
3 files changed, 31 insertions(+), 30 deletions(-)
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index 6991f9ac..fbe97662 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -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)
{
diff --git a/libmultipath/structs_vec.h b/libmultipath/structs_vec.h
index f8b9f63e..d3219278 100644
--- a/libmultipath/structs_vec.h
+++ b/libmultipath/structs_vec.h
@@ -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);
diff --git a/multipathd/main.c b/multipathd/main.c
index bb5c1f1d..a21d96e4 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -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)
{
--
2.24.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-11-27 15:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20191120125437.19372-1-martin.wilck@suse.com>
2019-11-20 12:55 ` [PATCH v2 1/5] multipathd: move set_no_path_retry() back to libmultipath Martin Wilck
2019-11-27 15:05 [PATCH v2 RESEND 0/5] Drop nr_active, and some more fixes Martin Wilck
2019-11-27 15:05 ` [PATCH v2 1/5] multipathd: move set_no_path_retry() back to libmultipath Martin Wilck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.