multipathd: remove references to sysfs_device
authorHannes Reinecke <hare@suse.de>
Thu, 19 Apr 2012 09:08:56 +0000 (11:08 +0200)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Fri, 20 Apr 2012 17:47:24 +0000 (19:47 +0200)
When processing events we don't need to take a reference to the
sysfs_device; it will be done later on during pathinfo.

Signed-off-by: Hannes Reinecke <hare@suse.de>
multipathd/main.c

index 9cf0a80..0667a2b 100644 (file)
@@ -372,14 +372,7 @@ ev_remove_map (char * devname, char * alias, int minor, struct vectors * vecs)
 static int
 uev_add_path (struct uevent *uev, struct vectors * vecs)
 {
-       struct sysfs_device * dev;
-
-       dev = sysfs_device_get(uev->devpath);
-       if (!dev) {
-               condlog(2, "%s: not found in sysfs", uev->devpath);
-               return 1;
-       }
-       condlog(2, "%s: add path (uevent)", dev->kernel);
+       condlog(2, "%s: add path (uevent)", uev->kernel);
        return (ev_add_path(dev->kernel, vecs) != 1)? 0 : 1;
 }
 
@@ -556,21 +549,10 @@ fail:
 static int
 uev_remove_path (struct uevent *uev, struct vectors * vecs)
 {
-       struct sysfs_device * dev;
        int retval;
 
-       dev = sysfs_device_get(uev->devpath);
-       if (!dev) {
-               condlog(2, "%s: not found in sysfs", uev->devpath);
-               return 1;
-       }
        condlog(2, "%s: remove path (uevent)", uev->kernel);
-       retval = ev_remove_path(uev->kernel, vecs);
-
-       if (!retval)
-               sysfs_device_put(dev);
-
-       return retval;
+       return ev_remove_path(uev->kernel, vecs);
 }
 
 int
@@ -679,14 +661,8 @@ fail:
 static int
 uev_update_path (struct uevent *uev, struct vectors * vecs)
 {
-       struct sysfs_device * dev;
        int retval, ro;
 
-       dev = sysfs_device_get(uev->devpath);
-       if (!dev) {
-               condlog(2, "%s: not found in sysfs", uev->devpath);
-               return 1;
-       }
        ro = uevent_get_disk_ro(uev);
 
        if (ro >= 0) {
@@ -708,8 +684,6 @@ uev_update_path (struct uevent *uev, struct vectors * vecs)
 
        }
 
-       sysfs_device_put(dev);
-
        return retval;
 }