aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorMiao Xie <miaox@cn.fujitsu.com>2012-11-26 04:24:43 -0500
committerChris Mason <chris.mason@fusionio.com>2012-12-16 20:46:11 -0500
commit9247f3170b2c3d648707c93bbebcd763fac17c06 (patch)
tree6e521e62171197502743b712271438be607ad293 /fs/btrfs/super.c
parent905b0dda06a064db08b8a814e968786ff3c4cc19 (diff)
Btrfs: use slabs for auto defrag allocation
The auto defrag allocation is in the fast path of the IO, so use slabs to improve the speed of the allocation. And besides that, it can do check for leaked objects when the module is removed. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index def4f24b58df..99545df1b86c 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1680,10 +1680,14 @@ static int __init init_btrfs_fs(void)
1680 if (err) 1680 if (err)
1681 goto free_ordered_data; 1681 goto free_ordered_data;
1682 1682
1683 err = btrfs_interface_init(); 1683 err = btrfs_auto_defrag_init();
1684 if (err) 1684 if (err)
1685 goto free_delayed_inode; 1685 goto free_delayed_inode;
1686 1686
1687 err = btrfs_interface_init();
1688 if (err)
1689 goto free_auto_defrag;
1690
1687 err = register_filesystem(&btrfs_fs_type); 1691 err = register_filesystem(&btrfs_fs_type);
1688 if (err) 1692 if (err)
1689 goto unregister_ioctl; 1693 goto unregister_ioctl;
@@ -1695,6 +1699,8 @@ static int __init init_btrfs_fs(void)
1695 1699
1696unregister_ioctl: 1700unregister_ioctl:
1697 btrfs_interface_exit(); 1701 btrfs_interface_exit();
1702free_auto_defrag:
1703 btrfs_auto_defrag_exit();
1698free_delayed_inode: 1704free_delayed_inode:
1699 btrfs_delayed_inode_exit(); 1705 btrfs_delayed_inode_exit();
1700free_ordered_data: 1706free_ordered_data:
@@ -1714,6 +1720,7 @@ free_compress:
1714static void __exit exit_btrfs_fs(void) 1720static void __exit exit_btrfs_fs(void)
1715{ 1721{
1716 btrfs_destroy_cachep(); 1722 btrfs_destroy_cachep();
1723 btrfs_auto_defrag_exit();
1717 btrfs_delayed_inode_exit(); 1724 btrfs_delayed_inode_exit();
1718 ordered_data_exit(); 1725 ordered_data_exit();
1719 extent_map_exit(); 1726 extent_map_exit();