aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hugetlbfs/inode.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-17 02:25:46 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:45 -0400
commite0bf68ddec4f4f90e5871404be4f1854c17f3120 (patch)
tree36203a3558cbe26d698bed18be69b3822fb5eef2 /fs/hugetlbfs/inode.c
parentdc62a30e274d003a4d08fb888f1520add4b21373 (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/hugetlbfs/inode.c')
-rw-r--r--fs/hugetlbfs/inode.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c
index 04598e12c489..0d9a2055ddee 100644
--- a/fs/hugetlbfs/inode.c
+++ b/fs/hugetlbfs/inode.c
@@ -974,11 +974,15 @@ static int __init init_hugetlbfs_fs(void)
974 int error; 974 int error;
975 struct vfsmount *vfsmount; 975 struct vfsmount *vfsmount;
976 976
977 error = bdi_init(&hugetlbfs_backing_dev_info);
978 if (error)
979 return error;
980
977 hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache", 981 hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache",
978 sizeof(struct hugetlbfs_inode_info), 982 sizeof(struct hugetlbfs_inode_info),
979 0, 0, init_once); 983 0, 0, init_once);
980 if (hugetlbfs_inode_cachep == NULL) 984 if (hugetlbfs_inode_cachep == NULL)
981 return -ENOMEM; 985 goto out2;
982 986
983 error = register_filesystem(&hugetlbfs_fs_type); 987 error = register_filesystem(&hugetlbfs_fs_type);
984 if (error) 988 if (error)
@@ -996,6 +1000,8 @@ static int __init init_hugetlbfs_fs(void)
996 out: 1000 out:
997 if (error) 1001 if (error)
998 kmem_cache_destroy(hugetlbfs_inode_cachep); 1002 kmem_cache_destroy(hugetlbfs_inode_cachep);
1003 out2:
1004 bdi_destroy(&hugetlbfs_backing_dev_info);
999 return error; 1005 return error;
1000} 1006}
1001 1007
@@ -1003,6 +1009,7 @@ static void __exit exit_hugetlbfs_fs(void)
1003{ 1009{
1004 kmem_cache_destroy(hugetlbfs_inode_cachep); 1010 kmem_cache_destroy(hugetlbfs_inode_cachep);
1005 unregister_filesystem(&hugetlbfs_fs_type); 1011 unregister_filesystem(&hugetlbfs_fs_type);
1012 bdi_destroy(&hugetlbfs_backing_dev_info);
1006} 1013}
1007 1014
1008module_init(init_hugetlbfs_fs) 1015module_init(init_hugetlbfs_fs)