diff options
Diffstat (limited to 'fs/hugetlbfs/inode.c')
-rw-r--r-- | fs/hugetlbfs/inode.c | 9 |
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 | ||
1008 | module_init(init_hugetlbfs_fs) | 1015 | module_init(init_hugetlbfs_fs) |