[multipath] remove dead maps
[platform/upstream/multipath-tools.git] / libmultipath / structs.c
index 1a8ae3f..7cb489f 100644 (file)
@@ -145,6 +145,24 @@ free_multipath (struct multipath * mpp, int free_paths)
 }
 
 void
+drop_multipath (vector mpvec, char * wwid, int free_paths)
+{
+       int i;
+       struct multipath * mpp;
+
+       if (!mpvec)
+               return;
+
+       vector_foreach_slot (mpvec, mpp, i) {
+               if (!strncmp(mpp->wwid, wwid, WWID_SIZE)) {
+                       free_multipath(mpp, free_paths);
+                       vector_del_slot(mpvec, i);
+                       return;
+               }
+       }
+}
+
+void
 free_multipathvec (vector mpvec, int free_paths)
 {
        int i;