multipathd: move set_no_path_retry() back to libmultipath
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/5 multipathd: move set_no_path_retry() back to libmultipath
From: Martin Wilck <[email protected]>
This function is useful elsewhere, too. No code changes except for changing the linkage.
Reviewed-by Benjamin Marzinski <[email protected]>
Signed-off-by Martin Wilck <[email protected]>
--- libmultipath/structs_vec.c | 30 ++++++++++++++++++++++++++++++ libmultipath/structs_vec.h | 1 + multipathd/main.c | 30 ------------------------------ 3 files changed, 31 insertions(+), 30 deletions(-)
libmultipath/structs_vec.c +30 -0
@@ -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) {
libmultipath/structs_vec.h +1 -0
@@ -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);
multipathd/main.c +0 -30
@@ -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) {
Signature · 1 line
2.24.0