sysfs: just use d_materialise_unique()
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 8 Jun 2012 00:56:54 +0000 (20:56 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 14 Jul 2012 12:35:12 +0000 (16:35 +0400)
same as for nfs et.al.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/sysfs/dir.c

index 77c44ce493f8cbd2e98f8ded1551a4c96c2c75e8..a5cf784f9cc2abec93c2a5272345838e20fb62ad 100644 (file)
@@ -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;