Cleanup function for a pathvec. Will be used in a follow-up
patch.

Signed-off-by: Martin Wilck <[email protected]>
---
 libmultipath/libmultipath.version | 1 +
 libmultipath/structs.c            | 5 +++++
 libmultipath/structs.h            | 1 +
 3 files changed, 7 insertions(+)

diff --git a/libmultipath/libmultipath.version 
b/libmultipath/libmultipath.version
index 1b67b16..366b829 100644
--- a/libmultipath/libmultipath.version
+++ b/libmultipath/libmultipath.version
@@ -70,6 +70,7 @@ global:
        cleanup_lock;
        cleanup_multipath;
        cleanup_multipath_and_paths;
+       cleanup_pathvec_and_free_paths;
        cleanup_udev_device_ptr;
        cleanup_udev_enumerate_ptr;
        coalesce_paths;
diff --git a/libmultipath/structs.c b/libmultipath/structs.c
index cde5991..08d8b87 100644
--- a/libmultipath/structs.c
+++ b/libmultipath/structs.c
@@ -199,6 +199,11 @@ free_pathvec (vector vec, enum free_path_mode free_paths)
        vector_free(vec);
 }
 
+void cleanup_pathvec_and_free_paths(vector *vec)
+{
+       free_pathvec(*vec, FREE_PATHS);
+}
+
 struct pathgroup *
 alloc_pathgroup (void)
 {
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
index e7a0585..d89582c 100644
--- a/libmultipath/structs.h
+++ b/libmultipath/structs.h
@@ -577,6 +577,7 @@ void *set_mpp_hwe(struct multipath *mpp, const struct path 
*pp);
 void uninitialize_path(struct path *pp);
 void free_path (struct path *);
 void free_pathvec (vector vec, enum free_path_mode free_paths);
+void cleanup_pathvec_and_free_paths(vector *vec);
 void free_pathgroup (struct pathgroup * pgp, enum free_path_mode free_paths);
 void free_pgvec (vector pgvec, enum free_path_mode free_paths);
 void free_multipath (struct multipath *, enum free_path_mode free_paths);
-- 
2.52.0


Reply via email to