mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 01:21:58 +00:00
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>
This commit is contained in:
parent
dc62a30e27
commit
e0bf68ddec
19 changed files with 131 additions and 7 deletions
|
@ -974,11 +974,15 @@ static int __init init_hugetlbfs_fs(void)
|
|||
int error;
|
||||
struct vfsmount *vfsmount;
|
||||
|
||||
error = bdi_init(&hugetlbfs_backing_dev_info);
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
hugetlbfs_inode_cachep = kmem_cache_create("hugetlbfs_inode_cache",
|
||||
sizeof(struct hugetlbfs_inode_info),
|
||||
0, 0, init_once);
|
||||
if (hugetlbfs_inode_cachep == NULL)
|
||||
return -ENOMEM;
|
||||
goto out2;
|
||||
|
||||
error = register_filesystem(&hugetlbfs_fs_type);
|
||||
if (error)
|
||||
|
@ -996,6 +1000,8 @@ static int __init init_hugetlbfs_fs(void)
|
|||
out:
|
||||
if (error)
|
||||
kmem_cache_destroy(hugetlbfs_inode_cachep);
|
||||
out2:
|
||||
bdi_destroy(&hugetlbfs_backing_dev_info);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -1003,6 +1009,7 @@ static void __exit exit_hugetlbfs_fs(void)
|
|||
{
|
||||
kmem_cache_destroy(hugetlbfs_inode_cachep);
|
||||
unregister_filesystem(&hugetlbfs_fs_type);
|
||||
bdi_destroy(&hugetlbfs_backing_dev_info);
|
||||
}
|
||||
|
||||
module_init(init_hugetlbfs_fs)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue