summaryrefslogtreecommitdiffstats
path: root/fs/sysfs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-06-08 02:56:54 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-14 14:35:12 +0200
commite77fb7cef87856d9d35f2f4d617d0b97148ee7c2 (patch)
tree5be57ddbe300bdd3d6bfc04632a9464c60f4c961 /fs/sysfs
parentsysfs: switch to ->s_d_op and ->d_release() (diff)
downloadlinux-e77fb7cef87856d9d35f2f4d617d0b97148ee7c2.tar.xz
linux-e77fb7cef87856d9d35f2f4d617d0b97148ee7c2.zip
sysfs: just use d_materialise_unique()
same as for nfs et.al. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/dir.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 77c44ce493f8..a5cf784f9cc2 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -793,14 +793,7 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry,
}
/* instantiate and hash dentry */
- ret = d_find_alias(inode);
- if (!ret) {
- d_add(dentry, inode);
- } else {
- d_move(ret, dentry);
- iput(inode);
- }
-
+ ret = d_materialise_unique(dentry, inode);
out_unlock:
mutex_unlock(&sysfs_mutex);
return ret;