[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <12725729403493@kroah.org>
Date: Thu, 29 Apr 2010 13:29:00 -0700
From: <gregkh@...e.de>
To: ebiederm@...ssion.com, bcrl@...et.ca, benjamin.thery@...l.net,
cornelia.huck@...ibm.com, eric.dumazet@...il.com, gregkh@...e.de,
kay.sievers@...y.org, netdev@...r.kernel.org, serue@...ibm.com,
tj@...nel.org
Subject: patch driver-core-implement-ns-directory-support-for-device-classes.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled
Subject: driver core: Implement ns directory support for device classes.
to my gregkh-2.6 tree. Its filename is
driver-core-implement-ns-directory-support-for-device-classes.patch
This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
>From ebiederm@...ssion.com Thu Apr 29 12:47:44 2010
From: "Eric W. Biederman" <ebiederm@...ssion.com>
Date: Tue, 30 Mar 2010 11:31:29 -0700
Subject: driver core: Implement ns directory support for device classes.
To: Greg Kroah-Hartman <gregkh@...e.de>
Cc: Kay Sievers <kay.sievers@...y.org>, linux-kernel@...r.kernel.org, Tejun Heo <tj@...nel.org>, Cornelia Huck <cornelia.huck@...ibm.com>, linux-fsdevel@...r.kernel.org, Eric Dumazet <eric.dumazet@...il.com>, Benjamin LaHaise <bcrl@...et.ca>, Serge Hallyn <serue@...ibm.com>, <netdev@...r.kernel.org>, "Eric W. Biederman" <ebiederm@...ssion.com>, Benjamin Thery <benjamin.thery@...l.net>
Message-ID: <1269973889-25260-6-git-send-email-ebiederm@...ssion.com>
From: Eric W. Biederman <ebiederm@...ssion.com>
device_del and device_rename were modified to use
sysfs_delete_link and sysfs_rename_link respectively to ensure
when these operations happen on devices whose classes
are in namespace directories they work properly.
Signed-off-by: Eric W. Biederman <ebiederm@...ssion.com>
Signed-off-by: Benjamin Thery <benjamin.thery@...l.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
drivers/base/core.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -786,7 +786,7 @@ out_device:
out_busid:
if (dev->kobj.parent != &dev->class->p->class_subsys.kobj &&
device_is_not_partition(dev))
- sysfs_remove_link(&dev->class->p->class_subsys.kobj,
+ sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj,
dev_name(dev));
#else
/* link in the class directory pointing to the device */
@@ -804,7 +804,7 @@ out_busid:
return 0;
out_busid:
- sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev_name(dev));
+ sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev));
#endif
out_subsys:
@@ -832,13 +832,13 @@ static void device_remove_class_symlinks
if (dev->kobj.parent != &dev->class->p->class_subsys.kobj &&
device_is_not_partition(dev))
- sysfs_remove_link(&dev->class->p->class_subsys.kobj,
+ sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj,
dev_name(dev));
#else
if (dev->parent && device_is_not_partition(dev))
sysfs_remove_link(&dev->kobj, "device");
- sysfs_remove_link(&dev->class->p->class_subsys.kobj, dev_name(dev));
+ sysfs_delete_link(&dev->class->p->class_subsys.kobj, &dev->kobj, dev_name(dev));
#endif
sysfs_remove_link(&dev->kobj, "subsystem");
@@ -1624,6 +1624,14 @@ int device_rename(struct device *dev, ch
goto out;
}
+#ifndef CONFIG_SYSFS_DEPRECATED
+ if (dev->class) {
+ error = sysfs_rename_link(&dev->class->p->class_subsys.kobj,
+ &dev->kobj, old_device_name, new_name);
+ if (error)
+ goto out;
+ }
+#endif
error = kobject_rename(&dev->kobj, new_name);
if (error)
goto out;
@@ -1638,11 +1646,6 @@ int device_rename(struct device *dev, ch
new_class_name);
}
}
-#else
- if (dev->class) {
- error = sysfs_rename_link(&dev->class->p->class_subsys.kobj,
- &dev->kobj, old_device_name, new_name);
- }
#endif
out:
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists