patch driver-core-use-sysfs_rename_link-in-device_rename.patch added to gregkh-2.6 tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    Subject: driver core: Use sysfs_rename_link in device_rename

to my gregkh-2.6 tree.  Its filename is

    driver-core-use-sysfs_rename_link-in-device_rename.patch

This tree can be found at 
    http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/


>From ebiederm@xxxxxxxxxxxx  Tue Jun  2 15:34:29 2009
From: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>
Date: Fri, 29 May 2009 13:19:12 -0700
Subject: driver core: Use sysfs_rename_link in device_rename
To: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxx>
Cc: Tejun Heo <tj@xxxxxxxxxx>, Cornelia Huck <cornelia.huck@xxxxxxxxxx>, <linux-fsdevel@xxxxxxxxxxxxxxx>, Kay Sievers <kay.sievers@xxxxxxxx>, Greg KH <greg@xxxxxxxxx>, "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx>, "Eric W. Biederman" <ebiederm@xxxxxxxxxxxxxxxxxx>
Message-ID: <1243628376-22905-2-git-send-email-ebiederm@xxxxxxxxxxxx>


From: Eric W. Biederman <ebiederm@xxxxxxxxxxxx>

Don't open code the renaming of symlinks in sysfs
instead use the new helper function sysfs_rename_link

Signed-off-by: Eric W. Biederman <ebiederm@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
 drivers/base/core.c |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1546,22 +1546,16 @@ int device_rename(struct device *dev, ch
 	if (old_class_name) {
 		new_class_name = make_class_name(dev->class->name, &dev->kobj);
 		if (new_class_name) {
-			error = sysfs_create_link_nowarn(&dev->parent->kobj,
-							 &dev->kobj,
-							 new_class_name);
-			if (error)
-				goto out;
-			sysfs_remove_link(&dev->parent->kobj, old_class_name);
+			error = sysfs_rename_link(&dev->parent->kobj,
+						  &dev->kobj,
+						  old_class_name,
+						  new_class_name);
 		}
 	}
 #else
 	if (dev->class) {
-		error = sysfs_create_link_nowarn(&dev->class->p->class_subsys.kobj,
-						 &dev->kobj, dev_name(dev));
-		if (error)
-			goto out;
-		sysfs_remove_link(&dev->class->p->class_subsys.kobj,
-				  old_device_name);
+		error = sysfs_rename_link(&dev->class->p->class_subsys.kobj,
+					  &dev->kobj, old_device_name, new_name);
 	}
 #endif
 

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux