FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 04-19-2012, 09:08 AM
Hannes Reinecke
 
Default multipathd: remove references to sysfs_device

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 | 30 ++----------------------------
1 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index 9cf0a80..0667a2b 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -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;
}

--
1.7.3.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 
Old 04-30-2012, 10:25 AM
Hannes Reinecke
 
Default multipathd: remove references to sysfs_device

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 | 30 ++----------------------------
1 files changed, 2 insertions(+), 28 deletions(-)

diff --git a/multipathd/main.c b/multipathd/main.c
index 9cf0a80..0667a2b 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -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;
}

--
1.7.3.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 07:00 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org