summaryrefslogtreecommitdiff
path: root/fs/configfs/inode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2019-09-11 09:57:38 +0300
committerChristoph Hellwig <hch@lst.de>2019-09-11 13:46:10 +0300
commit2743c515a1239bb96028bddafef87c0a486f4361 (patch)
tree19bd60d261eb5c95ec638f8fdda2e56595868bc8 /fs/configfs/inode.c
parent1cf7a003b044744c06dfa452cd136e71223b5569 (diff)
downloadlinux-2743c515a1239bb96028bddafef87c0a486f4361.tar.xz
configfs: make configfs_create() return inode
Get rid of the callback, deal with that and dentry in callers Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/configfs/inode.c')
-rw-r--r--fs/configfs/inode.c24
1 files changed, 5 insertions, 19 deletions
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c
index ab0284321912..9c3d309839a8 100644
--- a/fs/configfs/inode.c
+++ b/fs/configfs/inode.c
@@ -164,41 +164,27 @@ static void configfs_set_inode_lock_class(struct configfs_dirent *sd,
#endif /* CONFIG_LOCKDEP */
-int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct inode *))
+struct inode *configfs_create(struct dentry *dentry, umode_t mode)
{
- int error = 0;
struct inode *inode = NULL;
struct configfs_dirent *sd;
struct inode *p_inode;
if (!dentry)
- return -ENOENT;
+ return ERR_PTR(-ENOENT);
if (d_really_is_positive(dentry))
- return -EEXIST;
+ return ERR_PTR(-EEXIST);
sd = dentry->d_fsdata;
inode = configfs_new_inode(mode, sd, dentry->d_sb);
if (!inode)
- return -ENOMEM;
+ return ERR_PTR(-ENOMEM);
p_inode = d_inode(dentry->d_parent);
p_inode->i_mtime = p_inode->i_ctime = current_time(p_inode);
configfs_set_inode_lock_class(sd, inode);
-
- init(inode);
- 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;
+ return inode;
}
/*