diff options
author | 2019-09-11 08:57:38 +0200 | |
---|---|---|
committer | 2019-09-11 12:46:10 +0200 | |
commit | 2743c515a1239bb96028bddafef87c0a486f4361 (patch) | |
tree | 19bd60d261eb5c95ec638f8fdda2e56595868bc8 /fs/configfs/inode.c | |
parent | configfs: factor dirent removal into helpers (diff) | |
download | linux-2743c515a1239bb96028bddafef87c0a486f4361.tar.gz linux-2743c515a1239bb96028bddafef87c0a486f4361.tar.bz2 linux-2743c515a1239bb96028bddafef87c0a486f4361.zip |
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.c | 24 |
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; } /* |