diff options
Diffstat (limited to 'fs/configfs')
-rw-r--r-- | fs/configfs/configfs_internal.h | 2 | ||||
-rw-r--r-- | fs/configfs/inode.c | 8 | ||||
-rw-r--r-- | fs/configfs/mount.c | 9 |
3 files changed, 19 insertions, 0 deletions
diff --git a/fs/configfs/configfs_internal.h b/fs/configfs/configfs_internal.h index 3b0185fdf9a4..cca98609aa7f 100644 --- a/fs/configfs/configfs_internal.h +++ b/fs/configfs/configfs_internal.h | |||
@@ -56,6 +56,8 @@ extern int configfs_is_root(struct config_item *item); | |||
56 | 56 | ||
57 | extern struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent *); | 57 | extern struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent *); |
58 | extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *)); | 58 | extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *)); |
59 | extern int configfs_inode_init(void); | ||
60 | extern void configfs_inode_exit(void); | ||
59 | 61 | ||
60 | extern int configfs_create_file(struct config_item *, const struct configfs_attribute *); | 62 | extern int configfs_create_file(struct config_item *, const struct configfs_attribute *); |
61 | extern int configfs_make_dirent(struct configfs_dirent *, | 63 | extern int configfs_make_dirent(struct configfs_dirent *, |
diff --git a/fs/configfs/inode.c b/fs/configfs/inode.c index dbd257d956c4..4c1ebff778ee 100644 --- a/fs/configfs/inode.c +++ b/fs/configfs/inode.c | |||
@@ -256,4 +256,12 @@ void configfs_hash_and_remove(struct dentry * dir, const char * name) | |||
256 | mutex_unlock(&dir->d_inode->i_mutex); | 256 | mutex_unlock(&dir->d_inode->i_mutex); |
257 | } | 257 | } |
258 | 258 | ||
259 | int __init configfs_inode_init(void) | ||
260 | { | ||
261 | return bdi_init(&configfs_backing_dev_info); | ||
262 | } | ||
259 | 263 | ||
264 | void __exit configfs_inode_exit(void) | ||
265 | { | ||
266 | bdi_destroy(&configfs_backing_dev_info); | ||
267 | } | ||
diff --git a/fs/configfs/mount.c b/fs/configfs/mount.c index 871b0cb61839..3bf0278ea843 100644 --- a/fs/configfs/mount.c +++ b/fs/configfs/mount.c | |||
@@ -154,8 +154,16 @@ static int __init configfs_init(void) | |||
154 | subsystem_unregister(&config_subsys); | 154 | subsystem_unregister(&config_subsys); |
155 | kmem_cache_destroy(configfs_dir_cachep); | 155 | kmem_cache_destroy(configfs_dir_cachep); |
156 | configfs_dir_cachep = NULL; | 156 | configfs_dir_cachep = NULL; |
157 | goto out; | ||
157 | } | 158 | } |
158 | 159 | ||
160 | err = configfs_inode_init(); | ||
161 | if (err) { | ||
162 | unregister_filesystem(&configfs_fs_type); | ||
163 | subsystem_unregister(&config_subsys); | ||
164 | kmem_cache_destroy(configfs_dir_cachep); | ||
165 | configfs_dir_cachep = NULL; | ||
166 | } | ||
159 | out: | 167 | out: |
160 | return err; | 168 | return err; |
161 | } | 169 | } |
@@ -166,6 +174,7 @@ static void __exit configfs_exit(void) | |||
166 | subsystem_unregister(&config_subsys); | 174 | subsystem_unregister(&config_subsys); |
167 | kmem_cache_destroy(configfs_dir_cachep); | 175 | kmem_cache_destroy(configfs_dir_cachep); |
168 | configfs_dir_cachep = NULL; | 176 | configfs_dir_cachep = NULL; |
177 | configfs_inode_exit(); | ||
169 | } | 178 | } |
170 | 179 | ||
171 | MODULE_AUTHOR("Oracle"); | 180 | MODULE_AUTHOR("Oracle"); |