[dm-devel] [PATCH v2 41/48] libmultipath: skip unneeded steps to get path name
mwilck at suse.com
mwilck at suse.com
Thu Nov 18 22:58:33 UTC 2021
From: Benjamin Marzinski <bmarzins at redhat.com>
The path already must have a udev device at this point, so it just
needs to copy the sysname from it.
Signed-off-by: Benjamin Marzinski <bmarzins at redhat.com>
Reviewed-by: Martin Wilck <mwilck at suse.com>
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
libmultipath/structs_vec.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index e52db0c..4d56107 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -1,6 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#include <libudev.h>
#include "util.h"
#include "checkers.h"
@@ -174,8 +175,8 @@ bool update_pathvec_from_dm(vector pathvec, struct multipath *mpp,
} else {
int rc;
- devt2devname(pp->dev, sizeof(pp->dev),
- pp->dev_t);
+ strlcpy(pp->dev, udev_device_get_sysname(pp->udev),
+ sizeof(pp->dev));
conf = get_multipath_config();
pthread_cleanup_push(put_multipath_config,
conf);
--
2.33.1
More information about the dm-devel
mailing list