diff options
Diffstat (limited to 'fs/configfs/inode.c')
-rw-r--r-- | fs/configfs/inode.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index 65af86147154..5423a6a6ecc8 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c | |||
@@ -176,7 +176,7 @@ static void configfs_set_inode_lock_class(struct configfs_dirent *sd, | |||
176 | 176 | ||
177 | #endif /* CONFIG_LOCKDEP */ | 177 | #endif /* CONFIG_LOCKDEP */ |
178 | 178 | ||
179 | int configfs_create(struct dentry * dentry, umode_t mode, int (*init)(struct inode *)) | 179 | int configfs_create(struct dentry * dentry, umode_t mode, void (*init)(struct inode *)) |
180 | { | 180 | { |
181 | int error = 0; | 181 | int error = 0; |
182 | struct inode *inode = NULL; | 182 | struct inode *inode = NULL; |
@@ -198,13 +198,7 @@ int configfs_create(struct dentry * dentry, umode_t mode, int (*init)(struct ino | |||
198 | p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME; | 198 | p_inode->i_mtime = p_inode->i_ctime = CURRENT_TIME; |
199 | configfs_set_inode_lock_class(sd, inode); | 199 | configfs_set_inode_lock_class(sd, inode); |
200 | 200 | ||
201 | if (init) { | 201 | init(inode); |
202 | error = init(inode); | ||
203 | if (error) { | ||
204 | iput(inode); | ||
205 | return error; | ||
206 | } | ||
207 | } | ||
208 | d_instantiate(dentry, inode); | 202 | d_instantiate(dentry, inode); |
209 | if (S_ISDIR(mode) || S_ISLNK(mode)) | 203 | if (S_ISDIR(mode) || S_ISLNK(mode)) |
210 | dget(dentry); /* pin link and directory dentries in core */ | 204 | dget(dentry); /* pin link and directory dentries in core */ |
@@ -242,7 +236,7 @@ void configfs_drop_dentry(struct configfs_dirent * sd, struct dentry * parent) | |||
242 | 236 | ||
243 | if (dentry) { | 237 | if (dentry) { |
244 | spin_lock(&dentry->d_lock); | 238 | spin_lock(&dentry->d_lock); |
245 | if (!(d_unhashed(dentry) && dentry->d_inode)) { | 239 | if (!d_unhashed(dentry) && dentry->d_inode) { |
246 | dget_dlock(dentry); | 240 | dget_dlock(dentry); |
247 | __d_drop(dentry); | 241 | __d_drop(dentry); |
248 | spin_unlock(&dentry->d_lock); | 242 | spin_unlock(&dentry->d_lock); |