@@ -742,28 +742,17 @@ cli_del_map (void * v, struct strbuf *reply, void * data)
{
struct vectors * vecs = (struct vectors *)data;
char * param = get_keyparam(v, KEY_MAP);
- int major, minor;
- char *alias;
- int rc;
+ struct multipath *mpp;
param = convert_dev(param, 0);
condlog(2, "%s: remove map (operator)", param);
- if (dm_get_major_minor(param, &major, &minor) < 0) {
- condlog(2, "%s: not a device mapper table", param);
- return 1;
- }
- alias = dm_mapname(major, minor);
- if (!alias) {
- condlog(2, "%s: mapname not found for %d:%d",
- param, major, minor);
+
+ mpp = find_mp_by_str(vecs->mpvec, param);
+
+ if (!mpp)
return 1;
- }
- rc = ev_remove_map(param, alias, minor, vecs);
- if (rc == 2)
- append_strbuf_str(reply, "delayed\n");
- free(alias);
- return rc;
+ return flush_map(mpp, vecs);
}
static int
@@ -931,27 +931,6 @@ out:
return 0;
}
-/* Called from CLI handler */
-int
-ev_remove_map (char * devname, char * alias, int minor, struct vectors * vecs)
-{
- struct multipath * mpp;
-
- mpp = find_mp_by_minor(vecs->mpvec, minor);
-
- if (!mpp) {
- condlog(2, "%s: devmap not registered, can't remove",
- devname);
- return 1;
- }
- if (strcmp(mpp->alias, alias)) {
- condlog(2, "%s: minor number mismatch (map %d, event %d)",
- mpp->alias, mpp->dmi.minor, minor);
- return 1;
- }
- return flush_map(mpp, vecs);
-}
-
static void
rescan_path(struct udev_device *ud)
{
@@ -39,7 +39,6 @@ int need_to_delay_reconfig (struct vectors *);
int ev_add_path (struct path *, struct vectors *, int);
int ev_remove_path (struct path *, struct vectors *, int);
int ev_add_map (char *, const char *, struct vectors *);
-int ev_remove_map (char *, char *, int, struct vectors *);
int flush_map(struct multipath *, struct vectors *);
void handle_signals(bool);