aboutsummaryrefslogtreecommitdiffstats
path: root/fs/configfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/configfs')
-rw-r--r--fs/configfs/configfs_internal.h2
-rw-r--r--fs/configfs/inode.c8
-rw-r--r--fs/configfs/mount.c9
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
57extern struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent *); 57extern struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent *);
58extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *)); 58extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *));
59extern int configfs_inode_init(void);
60extern void configfs_inode_exit(void);
59 61
60extern int configfs_create_file(struct config_item *, const struct configfs_attribute *); 62extern int configfs_create_file(struct config_item *, const struct configfs_attribute *);
61extern int configfs_make_dirent(struct configfs_dirent *, 63extern 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
259int __init configfs_inode_init(void)
260{
261 return bdi_init(&configfs_backing_dev_info);
262}
259 263
264void __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 }
159out: 167out:
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
171MODULE_AUTHOR("Oracle"); 180MODULE_AUTHOR("Oracle");