diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-01-29 00:17:57 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-02-17 22:15:47 -0500 |
commit | c88b1e70aeaa38aa20e67e436f28c4d36c0b9f4b (patch) | |
tree | 76b3c8285ba4638f2d923e07eda0c3f90a380ff1 | |
parent | dbca51ddb053567a5248cff0d863301417555b2f (diff) |
configfs: configfs_create() init callback is never NULL and it never fails
... so make it return void and drop the check for it being non-NULL
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/configfs/configfs_internal.h | 2 | ||||
-rw-r--r-- | fs/configfs/dir.c | 9 | ||||
-rw-r--r-- | fs/configfs/inode.c | 10 |
3 files changed, 6 insertions, 15 deletions
diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h index a315677e44d3..ed0fdd156880 100644 --- a/fs/configfs/configfs_internal.h +++ b/fs/configfs/configfs_internal.h | |||
@@ -69,7 +69,7 @@ extern struct kmem_cache *configfs_dir_cachep; | |||
69 | extern int configfs_is_root(struct config_item *item); | 69 | extern int configfs_is_root(struct config_item *item); |
70 | 70 | ||
71 | extern struct inode * configfs_new_inode(umode_t mode, struct configfs_dirent *, struct super_block *); | 71 | extern struct inode * configfs_new_inode(umode_t mode, struct configfs_dirent *, struct super_block *); |
72 | extern int configfs_create(struct dentry *, umode_t mode, int (*init)(struct inode *)); | 72 | extern int configfs_create(struct dentry *, umode_t mode, void (*init)(struct inode *)); |
73 | 73 | ||
74 | extern int configfs_create_file(struct config_item *, const struct configfs_attribute *); | 74 | extern int configfs_create_file(struct config_item *, const struct configfs_attribute *); |
75 | extern int configfs_make_dirent(struct configfs_dirent *, | 75 | extern int configfs_make_dirent(struct configfs_dirent *, |
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index c9c298bd3058..6371ba19ee43 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
@@ -240,27 +240,24 @@ int configfs_make_dirent(struct configfs_dirent * parent_sd, | |||
240 | return 0; | 240 | return 0; |
241 | } | 241 | } |
242 | 242 | ||
243 | static int init_dir(struct inode * inode) | 243 | static void init_dir(struct inode * inode) |
244 | { | 244 | { |
245 | inode->i_op = &configfs_dir_inode_operations; | 245 | inode->i_op = &configfs_dir_inode_operations; |
246 | inode->i_fop = &configfs_dir_operations; | 246 | inode->i_fop = &configfs_dir_operations; |
247 | 247 | ||
248 | /* directory inodes start off with i_nlink == 2 (for "." entry) */ | 248 | /* directory inodes start off with i_nlink == 2 (for "." entry) */ |
249 | inc_nlink(inode); | 249 | inc_nlink(inode); |
250 | return 0; | ||
251 | } | 250 | } |
252 | 251 | ||
253 | static int configfs_init_file(struct inode * inode) | 252 | static void configfs_init_file(struct inode * inode) |
254 | { | 253 | { |
255 | inode->i_size = PAGE_SIZE; | 254 | inode->i_size = PAGE_SIZE; |
256 | inode->i_fop = &configfs_file_operations; | 255 | inode->i_fop = &configfs_file_operations; |
257 | return 0; | ||
258 | } | 256 | } |
259 | 257 | ||
260 | static int init_symlink(struct inode * inode) | 258 | static void init_symlink(struct inode * inode) |
261 | { | 259 | { |
262 | inode->i_op = &configfs_symlink_inode_operations; | 260 | inode->i_op = &configfs_symlink_inode_operations; |
263 | return 0; | ||
264 | } | 261 | } |
265 | 262 | ||
266 | static int create_dir(struct config_item *k, struct dentry *d) | 263 | static int create_dir(struct config_item *k, struct dentry *d) |
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index 65af86147154..60727db7b0a3 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 */ |