@@ -1159,7 +1159,7 @@ dm_flush_map_nopaths(const char * mapname,
#endif
-int dm_flush_maps (int need_suspend, int retries)
+int dm_flush_maps (int retries)
{
int r = 1;
struct dm_task *dmt;
@@ -1184,10 +1184,7 @@ int dm_flush_maps (int need_suspend, int retries)
goto out;
do {
- if (need_suspend)
- r |= dm_suspend_and_flush_map(names->name, retries);
- else
- r |= dm_flush_map(names->name);
+ r |= dm_suspend_and_flush_map(names->name, retries);
next = names->next;
names = (void *) names + next;
} while (next);
@@ -55,7 +55,7 @@ int dm_flush_map_nopaths(const char * mapname, int deferred_remove);
#define dm_suspend_and_flush_map(mapname, retries) \
_dm_flush_map(mapname, 1, 0, 1, retries)
int dm_cancel_deferred_remove(struct multipath *mpp);
-int dm_flush_maps (int need_suspend, int retries);
+int dm_flush_maps (int retries);
int dm_fail_path(const char * mapname, char * path);
int dm_reinstate_path(const char * mapname, char * path);
int dm_queue_if_no_path(struct multipath *mpp, int enable);
@@ -1075,7 +1075,7 @@ main (int argc, char *argv[])
goto out;
}
else if (cmd == CMD_FLUSH_ALL) {
- r = dm_flush_maps(1, retries) ? RTVL_FAIL : RTVL_OK;
+ r = dm_flush_maps(retries) ? RTVL_FAIL : RTVL_OK;
goto out;
}
while ((r = configure(conf, cmd, dev_type, dev)) == RTVL_RETRY)
@@ -781,7 +781,7 @@ cli_del_maps (void *v, struct strbuf *reply, void *data)
i--;
}
/* flush any multipath maps that aren't currently known by multipathd */
- ret |= dm_flush_maps(0, 0);
+ ret |= dm_flush_maps(0);
return ret;
}
Make cli_del_maps() call dm_suspend_and_flush_map() for the unknown multipath devices as well. After this change, all callers of cli_del_maps() set need_suspend, so simplify dm_flush_maps(). Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> --- libmultipath/devmapper.c | 7 ++----- libmultipath/devmapper.h | 2 +- multipath/main.c | 2 +- multipathd/cli_handlers.c | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-)