From: Andrew Morton Cc: Greg KH Signed-off-by: Andrew Morton --- fs/sysfs/dir.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff -puN fs/sysfs/dir.c~fs-sysfs-dirc-remove-unused-__sysfs_get_dentry fs/sysfs/dir.c --- a/fs/sysfs/dir.c~fs-sysfs-dirc-remove-unused-__sysfs_get_dentry +++ a/fs/sysfs/dir.c @@ -795,45 +795,6 @@ void sysfs_remove_dir(struct kobject * k __sysfs_remove_dir(sd); } -/** - * __sysfs_get_dentry - get dentry for the given sysfs_dirent - * @sb: superblock of the dentry to return - * @sd: sysfs_dirent of interest - * - * Get dentry for @sd. Only return a dentry if one currently - * exists. - * - * LOCKING: - * Kernel thread context (may sleep) - * - * RETURNS: - * Pointer to found dentry on success, NULL on failure. - */ -static struct dentry *__sysfs_get_dentry(struct super_block *sb, - struct sysfs_dirent *sd) -{ - struct inode *inode; - struct dentry *dentry = NULL; - - inode = ilookup5_nowait(sysfs_sb, sd->s_ino, sysfs_ilookup_test, sd); - if (inode && !(inode->i_state & I_NEW)) { - struct dentry *alias; - spin_lock(&dcache_lock); - list_for_each_entry(alias, &inode->i_dentry, d_alias) { - if (!IS_ROOT(alias) && d_unhashed(alias)) - continue; - if (alias->d_sb != sb) - continue; - dentry = alias; - dget_locked(dentry); - break; - } - spin_unlock(&dcache_lock); - } - iput(inode); - return dentry; -} - struct sysfs_rename_struct { struct list_head list; struct dentry *old_dentry; _