diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-03-07 14:25:46 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-03-14 00:15:55 -0400 |
commit | 5cf3b560af903c82e9fc12578fac2fbcb8ca1533 (patch) | |
tree | 690f56e3adb5366db3a48ef457269610f4ab284a /fs/configfs/inode.c | |
parent | f7380af04bac0ecee88c10dba037749b14d26e7d (diff) | |
download | op-kernel-dev-5cf3b560af903c82e9fc12578fac2fbcb8ca1533.zip op-kernel-dev-5cf3b560af903c82e9fc12578fac2fbcb8ca1533.tar.gz |
configfs: move d_rehash() into configfs_create() for regular files
... and turn it into d_add in there
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/configfs/inode.c')
-rw-r--r-- | fs/configfs/inode.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index cee087d..45811ea 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c @@ -199,9 +199,17 @@ int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct in configfs_set_inode_lock_class(sd, inode); init(inode); - d_instantiate(dentry, inode); - if (S_ISDIR(mode) || S_ISLNK(mode)) + if (S_ISDIR(mode) || S_ISLNK(mode)) { + /* + * ->symlink(), ->mkdir(), configfs_register_subsystem() or + * create_default_group() - already hashed. + */ + d_instantiate(dentry, inode); dget(dentry); /* pin link and directory dentries in core */ + } else { + /* ->lookup() */ + d_add(dentry, inode); + } return error; } |