sysfs: In sysfs_lookup don't open code sysfs_find_dirent
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 20 Aug 2007 12:36:30 +0000 (21:36 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 12 Oct 2007 21:51:08 +0000 (14:51 -0700)
This is a small cleanup patch that makes the code just
a little bit cleaner.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/dir.c

index 7f4abe17670116bcf62b8e9dcba4f0c9dd37c82c..b72b42ed80d187256db2d566d5bdcd17adf58bb4 100644 (file)
@@ -756,9 +756,7 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry,
 
        mutex_lock(&sysfs_mutex);
 
-       for (sd = parent_sd->s_children; sd; sd = sd->s_sibling)
-               if (sysfs_type(sd) && !strcmp(sd->s_name, dentry->d_name.name))
-                       break;
+       sd = sysfs_find_dirent(parent_sd, dentry->d_name.name);
 
        /* no such entry */
        if (!sd)