diff options
author | Peter Zijlstra | 2007-10-16 23:25:46 -0700 |
---|---|---|
committer | Linus Torvalds | 2007-10-17 08:42:45 -0700 |
commit | e0bf68ddec4f4f90e5871404be4f1854c17f3120 (patch) | |
tree | 36203a3558cbe26d698bed18be69b3822fb5eef2 /fs/configfs | |
parent | dc62a30e274d003a4d08fb888f1520add4b21373 (diff) |
mm: bdi init hooks
provide BDI constructor/destructor hooks
[akpm@linux-foundation.org: compile fix]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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); extern struct inode * configfs_new_inode(mode_t mode, struct configfs_dirent *); extern int configfs_create(struct dentry *, int mode, int (*init)(struct inode *)); +extern int configfs_inode_init(void); +extern void configfs_inode_exit(void); extern int configfs_create_file(struct config_item *, const struct configfs_attribute *); 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) mutex_unlock(&dir->d_inode->i_mutex); } +int __init configfs_inode_init(void) +{ + return bdi_init(&configfs_backing_dev_info); +} +void __exit configfs_inode_exit(void) +{ + bdi_destroy(&configfs_backing_dev_info); +} 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) subsystem_unregister(&config_subsys); kmem_cache_destroy(configfs_dir_cachep); configfs_dir_cachep = NULL; + goto out; } + err = configfs_inode_init(); + if (err) { + unregister_filesystem(&configfs_fs_type); + subsystem_unregister(&config_subsys); + kmem_cache_destroy(configfs_dir_cachep); + configfs_dir_cachep = NULL; + } out: return err; } @@ -166,6 +174,7 @@ static void __exit configfs_exit(void) subsystem_unregister(&config_subsys); kmem_cache_destroy(configfs_dir_cachep); configfs_dir_cachep = NULL; + configfs_inode_exit(); } MODULE_AUTHOR("Oracle"); |