@@ -688,8 +688,7 @@ select_reload_action(struct multipath *mpp, const struct multipath *cmpp,
reason);
}
-static void
-select_action (struct multipath * mpp, vector curmp, int force_reload)
+void select_action (struct multipath *mpp, vector curmp, int force_reload)
{
struct multipath * cmpp;
struct multipath * cmpp_by_name;
@@ -1478,40 +1477,3 @@ int get_refwwid(enum mpath_cmds cmd, const char *dev, enum devtypes dev_type,
pthread_cleanup_pop(1);
return ret;
}
-
-int reload_map(struct vectors *vecs, struct multipath *mpp, int refresh,
- int is_daemon)
-{
- char params[PARAMS_SIZE] = {0};
- struct path *pp;
- int i, r;
-
- update_mpp_paths(mpp, vecs->pathvec);
- if (refresh) {
- vector_foreach_slot (mpp->paths, pp, i) {
- struct config *conf = get_multipath_config();
- pthread_cleanup_push(put_multipath_config, conf);
- r = pathinfo(pp, conf, DI_PRIO);
- pthread_cleanup_pop(1);
- if (r) {
- condlog(2, "%s: failed to refresh pathinfo",
- mpp->alias);
- return 1;
- }
- }
- }
- if (setup_map(mpp, params, PARAMS_SIZE, vecs)) {
- condlog(0, "%s: failed to setup map", mpp->alias);
- return 1;
- }
- select_action(mpp, vecs->mpvec, 1);
-
- r = domap(mpp, params, is_daemon);
- if (r == DOMAP_FAIL || r == DOMAP_RETRY) {
- condlog(3, "%s: domap (%u) failure "
- "for reload map", mpp->alias, r);
- return 1;
- }
-
- return 0;
-}
@@ -49,11 +49,11 @@ struct vectors;
int setup_map (struct multipath * mpp, char * params, int params_size,
struct vectors *vecs );
+void select_action (struct multipath *mpp, vector curmp, int force_reload);
int domap (struct multipath * mpp, char * params, int is_daemon);
int reinstate_paths (struct multipath *mpp);
int coalesce_paths (struct vectors *vecs, vector curmp, char * refwwid, int force_reload, enum mpath_cmds cmd);
int get_refwwid (enum mpath_cmds cmd, const char *dev, enum devtypes dev_type,
vector pathvec, char **wwid);
-int reload_map(struct vectors *vecs, struct multipath *mpp, int refresh, int is_daemon);
struct udev_device *get_udev_device(const char *dev, enum devtypes dev_type);
void trigger_paths_udev_change(struct multipath *mpp, bool is_mpath);
@@ -1909,6 +1909,43 @@ int update_prio(struct path *pp, int refresh_all)
return 1;
}
+static int reload_map(struct vectors *vecs, struct multipath *mpp, int refresh,
+ int is_daemon)
+{
+ char params[PARAMS_SIZE] = {0};
+ struct path *pp;
+ int i, r;
+
+ update_mpp_paths(mpp, vecs->pathvec);
+ if (refresh) {
+ vector_foreach_slot (mpp->paths, pp, i) {
+ struct config *conf = get_multipath_config();
+ pthread_cleanup_push(put_multipath_config, conf);
+ r = pathinfo(pp, conf, DI_PRIO);
+ pthread_cleanup_pop(1);
+ if (r) {
+ condlog(2, "%s: failed to refresh pathinfo",
+ mpp->alias);
+ return 1;
+ }
+ }
+ }
+ if (setup_map(mpp, params, PARAMS_SIZE, vecs)) {
+ condlog(0, "%s: failed to setup map", mpp->alias);
+ return 1;
+ }
+ select_action(mpp, vecs->mpvec, 1);
+
+ r = domap(mpp, params, is_daemon);
+ if (r == DOMAP_FAIL || r == DOMAP_RETRY) {
+ condlog(3, "%s: domap (%u) failure "
+ "for reload map", mpp->alias, r);
+ return 1;
+ }
+
+ return 0;
+}
+
int update_path_groups(struct multipath *mpp, struct vectors *vecs, int refresh)
{
if (reload_map(vecs, mpp, refresh, 1))